Skip to content

Commit

Permalink
when looking up a rows group, make sure it takes acount of the dataTr…
Browse files Browse the repository at this point in the history
…ee if present
  • Loading branch information
olifolkerd committed May 2, 2022
1 parent bc9318b commit 99b1742
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions dist/js/tabulator_esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4448,6 +4448,10 @@ class DataTree extends Module{
return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;
}

getTreeParentRoot(row){
return row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;
}

getFilteredTreeChildren(row){
var config = row.modules.dataTree,
output = [], children;
Expand Down Expand Up @@ -11684,6 +11688,10 @@ class GroupRows extends Module{
getRowGroup(row){
var match = false;

if(this.options("dataTree")){
row = this.table.modules.dataTree.getTreeParentRoot(row);
}

this.groupList.forEach((group) => {
var result = group.getRowGroup(row);

Expand Down
2 changes: 1 addition & 1 deletion dist/js/tabulator_esm.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/js/modules/DataTree/DataTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ class DataTree extends Module{
return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;
}

getTreeParentRoot(row){
return row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;
}

getFilteredTreeChildren(row){
var config = row.modules.dataTree,
output = [], children;
Expand Down
4 changes: 4 additions & 0 deletions src/js/modules/GroupRows/GroupRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ class GroupRows extends Module{
getRowGroup(row){
var match = false;

if(this.options("dataTree")){
row = this.table.modules.dataTree.getTreeParentRoot(row);
}

this.groupList.forEach((group) => {
var result = group.getRowGroup(row);

Expand Down

0 comments on commit 99b1742

Please sign in to comment.