Primeng tree checkbox selection issue

UI Components for Angular
Post Reply
dalton5
Posts: 2
Joined: 01 Nov 2019, 16:21

01 Nov 2019, 16:31

Hi,

I setup my selection in tree as checkbox.

In the slection property I have my model. I want the data behind the node.

So how can I get the data of the node in the selection and not the node?

I tried to do it with select or unselectnode but no chances.

Can you help?

Thanks,

My code is:

Code: Select all

 <p-tree [value]="treeSpes"
                        selectionMode="checkbox"
                        dataKey="SpecialityId"
                        [(selection)]="criteria.specialities"
                        (onNodeSelect)="selectNode($event)"
                        (onNodeUnselect)="unselectNode($event)"
                       >
                    <ng-template let-node pTemplate="default">
                        <div>
                            <span style="font-size: 18px;">
                                {{node.label}}
                            </span>
                          
                        </div>
                    </ng-template>
                </p-tree>

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

04 Nov 2019, 10:50

dalton5 wrote:
01 Nov 2019, 16:31
Hi,

I setup my selection in tree as checkbox.

In the slection property I have my model. I want the data behind the node.

So how can I get the data of the node in the selection and not the node?

I tried to do it with select or unselectnode but no chances.

Can you help?

Thanks,

My code is:

Code: Select all

 <p-tree [value]="treeSpes"
                        selectionMode="checkbox"
                        dataKey="SpecialityId"
                        [(selection)]="criteria.specialities"
                        (onNodeSelect)="selectNode($event)"
                        (onNodeUnselect)="unselectNode($event)"
                       >
                    <ng-template let-node pTemplate="default">
                        <div>
                            <span style="font-size: 18px;">
                                {{node.label}}
                            </span>
                          
                        </div>
                    </ng-template>
                </p-tree>
Hi,
Can you provide stackblitz sample using with https://stackblitz.com/github/primeface ... e-template .

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests