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

279
Visualizações
How to get the parent node id from ngx-treeview

I am using ngx-dropdown treeview for the tree dropdown structure. When I am selecting in the dropdown only child ids are getting.

the response is like

    [
    {id:1,categoryName:Test,subCategory:[{id:2,categoryName:child1},{id:3,categoryName:child2}]}
    {id:4,categoryName:Test2,subCategory:[{id:5,categoryName:child3},{id:6,categoryName:child4}]}
    ]

    <ngx-dropdown-treeview
     [items]="items"
     [config]="config"
     (selectedChange)="onSelectedChange($event)"
     (filterChange)="onFilterChange($event)"
     >
    </ngx-dropdown-treeview>

    onSelectedChange(event){
    console.log(event)
    }

If we select parent category Test, then the response is coming in the console like [2,3].
Is there any way to get the id of the parent category also? Like [1,2,3]

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