From d02467dcf970a014c14cc0271071e65c7a47c985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Fri, 17 May 2024 14:07:18 +0300 Subject: [PATCH] Fixed #15603 - Treetable | if you don't specify dataKey for p-treeTable and select any rows, all rows are selected --- src/app/components/treetable/treetable.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/treetable/treetable.ts b/src/app/components/treetable/treetable.ts index a56fe10ac56..ce75d0684b5 100755 --- a/src/app/components/treetable/treetable.ts +++ b/src/app/components/treetable/treetable.ts @@ -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) {