Skip to content

Commit 5bef239

Browse files
author
FalkWolsky
committed
Adding selectAll function to Table
1 parent 9f8b89b commit 5bef239

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

client/packages/lowcoder/src/comps/comps/tableComp/tableComp.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,19 @@ TableTmpComp = withMethodExposing(TableTmpComp, [
690690
comp.children.selection.children.selectedRowKeys.dispatchChangeValueAction([]);
691691
},
692692
},
693+
{
694+
method: {
695+
name: "selectAll",
696+
description: "Select all rows in the current filtered view",
697+
params: [],
698+
},
699+
execute: (comp) => {
700+
const displayData = comp.filterData ?? [];
701+
const allKeys = displayData.map((row) => row[OB_ROW_ORI_INDEX] + "");
702+
comp.children.selection.children.selectedRowKey.dispatchChangeValueAction(allKeys[0] || "0");
703+
comp.children.selection.children.selectedRowKeys.dispatchChangeValueAction(allKeys);
704+
},
705+
},
693706
{
694707
method: {
695708
name: "cancelChanges",

0 commit comments

Comments
 (0)