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

384
Visualizações
Display Jstree Attributes on the Right Side

I'm working on Jstree And I want to display a Node attribute on full right side of the screen. Css Currently Showing Like this I want to show the attribute like that

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can get that by using "wholerow" plugin and a little html/css in jstree nodes. Below is a working example without your icons.

var rawData = [
    {id: "1", parent: "#", label: "Main Item", amount: 10},
    {id: "1.1", parent: "1", label: "Child Item", amount: 4},
    {id: "1.1.1", parent: "1.1", label: "Sub Child Item", amount: 4},
    {id: "1.2", parent: "1", label: "Child Item 1", amount: 2},
    {id: "1.2.1", parent: "1.2", label: "CHeckkkk", amount: 2},
    {id: "1.3", parent: "1", label: "Child Item 2", amount: 2},
    {id: "1.4", parent: "1", label: "Child Item 3", amount: 2},
    {id: "1.5", parent: "1", label: "New Node 176", amount: 0},
    {id: "2", parent: "#", label: "New Node", amount: 0},
    {id: "3", parent: "#", label: "New Node 173", amount: 0},
    {id: "4", parent: "#", label: "New Node 175", amount: 0}
];

rawData.forEach((e, i) => e.text = `${e.label}<span class='amount'>${e.amount}</span>`);

$('#jstree').jstree({
    core: {
      data: rawData
    },
    plugins: ['wholerow']
  })
  .on('loaded.jstree', function() {
    $('#jstree').jstree('open_all');
  });
#jstree-container {
  width: 300px;
}

li.jstree-node a {
  width: 100%;
}

span.amount {
  float: right;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.12/themes/default/style.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.12/jstree.min.js"></script>

<div id="jstree-container">
  <div id="jstree"></div>
</div>

about 4 years ago · Juan Pablo Isaza Relatório
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