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

527
Visualizações
How to set Primeng P-tree selectionMode checkbox (Checked)true?

I am displaying primeng P-tree SelectionMode checkbox of (parent and child nodes) datas, after selection of nodes , I am filtering the selection property to get the ids of selected nodes but On load of screen how can i set tree nodes checked true with the help of ids.

I am attaching the stackblitz url for reference :- https://stackblitz.com/edit/primeng-treeselection-demo-ewe5tq?file=src%2Fapp%2Fapp.component.ts

Please help on these issue

Thanks in advance

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

0

With [(selection)]="selectedModulePermissions" we can give what is already selected. I'm sure you can think of a better way to pre-check what you want but for a simple demo this should do.

  ngOnInit() {
    this.defaultSelected()
  }

  defaultSelected() {
    this.selectedModulePermissions.push(this.modulePagePermissions[1])
    this.selectedModulePermissions.push(this.modulePagePermissions[0].children[0])
  }

Working example: https://stackblitz.com/edit/primeng-treeselection-demo-wuapns?file=src%2Fapp%2Fapp.component.ts

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