Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

525
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!