Skip to content

Commit

Permalink
show parent row even when there are no children in grouped tables. fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis authored and p0psicles committed Jun 24, 2020
1 parent bbda469 commit 09e3160
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dev/grouped-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:group-options="{
enabled: true,
headerPosition: 'top',
collapsable: 2,
collapsable: true,
maintainExpanded: true,
}"
styleClass="vgt-table condensed bordered"
Expand Down
8 changes: 3 additions & 5 deletions src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,9 @@ export default {
each(this.processedRows, (headerRow) => {
const i = headerRow.vgt_header_id;
const children = filter(paginatedRows, ['vgt_id', i]);
if (children.length) {
const newHeaderRow = cloneDeep(headerRow);
newHeaderRow.children = children;
reconstructedRows.push(newHeaderRow);
}
const newHeaderRow = cloneDeep(headerRow);
newHeaderRow.children = children;
reconstructedRows.push(newHeaderRow);
});
return reconstructedRows;
},
Expand Down

0 comments on commit 09e3160

Please sign in to comment.