Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda