Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

122
Vistas
get the name of the clicked node from jstree

I'm trying to get the name of the clicked node from jstree

I'm not good in ajax I'm trying this way that I found but is not working, and i don't know from where the problem come

folderTreeView = $(".folderpreview");
        var datanew = JSON.parse(data)
        // Files Treeview
        if (folderTreeView.length) {
          folderTreeView.jstree({
            core: {
              themes: {
                dots: false,
              },
              data: datanew.children,
            },
            plugins: ["types"],
            types: {
              default: {
                icon: "far fa-folder font-medium-1",
              },
              ".jpg": {
                icon: "far fa-file-image text-info font-medium-1",
              },
              ".docx": {
                icon: "far fa-file-word text-info font-medium-1",
              },
              ".pdf": {
                icon: "far fa-file-pdf text-info font-medium-1",
              },
            },
          });

          folderTreeView
            .on("changed.jstree", function (e, data) {
              var i, j, r = [];
              for (i = 0, j = data.selected.length; i < j; i++) {
                r.push(data.instance.get_node(data.selected[i]).name);
              }
              $("#event_result").html("Selected: " + r.join(", "));
            })
            .jstree({
              core: {
                data: {
                  url: function (node) {
                    return node.id === "#" ? "./ajax_roots.json" : "./ajax_children.json";
                  },
                  data: function (node) {
                    return { 'id' : node.id};
                  },
                },
              },
            });
        }
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda