Skip to content

Commit

Permalink
Fixed #15603 - Treetable | if you don't specify dataKey for p-treeTab…
Browse files Browse the repository at this point in the history
…le and select any rows, all rows are selected
  • Loading branch information
mehmetcetin01140 committed May 17, 2024
1 parent b55baa8 commit d02467d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/components/treetable/treetable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,9 @@ export class TreeTable implements AfterContentInit, OnInit, OnDestroy, Blockable
}

nodeKey(node) {
return ObjectUtils.resolveFieldData(node, this.dataKey) || ObjectUtils.resolveFieldData(node?.data, this.dataKey);
if (this.dataKey) {
return ObjectUtils.resolveFieldData(node, this.dataKey) || ObjectUtils.resolveFieldData(node?.data, this.dataKey);
} else return node?.key;
}

toggleCheckbox(event) {
Expand Down

0 comments on commit d02467d

Please sign in to comment.