Skip to content

Commit

Permalink
fix: treetable checkbox demo
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 9, 2025
1 parent 3777f7a commit c79e54e
Showing 1 changed file with 39 additions and 3 deletions.
42 changes: 39 additions & 3 deletions apps/showcase/doc/treetable/selectioncheckboxdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface Column {
<tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
<td *ngFor="let col of columns; let i = index">
<p-treeTableToggler [rowNode]="rowNode" *ngIf="i === 0" />
<p-treetableCheckbox [value]="rowNode" *ngIf="i === 0" />
<p-treeTableCheckbox [value]="rowNode" *ngIf="i === 0" />
{{ rowData[col.field] }}
</td>
</tr>
Expand Down Expand Up @@ -71,9 +71,21 @@ export class SelectionCheckboxDoc {
];

this.selectionKeys = {
'0': {
partialChecked: true
},
'0-0': {
partialChecked: false,
checked: true
},
'0-0-0': {
checked: true
},
'0-0-1': {
checked: true
},
'0-0-2': {
checked: true
}
};
}
Expand All @@ -91,7 +103,7 @@ export class SelectionCheckboxDoc {
<tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
<td *ngFor="let col of columns; let i = index">
<p-treeTableToggler [rowNode]="rowNode" *ngIf="i === 0" />
<p-treetableCheckbox [value]="rowNode" *ngIf="i === 0" />
<p-treeTableCheckbox [value]="rowNode" *ngIf="i === 0" />
{{ rowData[col.field] }}
</td>
</tr>
Expand All @@ -111,7 +123,7 @@ export class SelectionCheckboxDoc {
<tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
<td *ngFor="let col of columns; let i = index">
<p-treeTableToggler [rowNode]="rowNode" *ngIf="i === 0" />
<p-treetableCheckbox [value]="rowNode" *ngIf="i === 0" />
<p-treeTableCheckbox [value]="rowNode" *ngIf="i === 0" />
{{ rowData[col.field] }}
</td>
</tr>
Expand Down Expand Up @@ -156,9 +168,21 @@ export class TreeTableSelectionCheckboxDemo implements OnInit {
];
this.selectionKeys = {
'0': {
partialChecked: true
},
'0-0': {
partialChecked: false,
checked: true
},
'0-0-0': {
checked: true
},
'0-0-1': {
checked: true
},
'0-0-2': {
checked: true
}
};
}
Expand All @@ -169,9 +193,21 @@ export class TreeTableSelectionCheckboxDemo implements OnInit {

code2: Code = {
typescript: `{
'0': {
partialChecked: true
},
'0-0': {
partialChecked: false,
checked: true
},
'0-0-0': {
checked: true
},
'0-0-1': {
checked: true
},
'0-0-2': {
checked: true
}
}`
};
Expand Down

0 comments on commit c79e54e

Please sign in to comment.