From 8aff895bc90196a6b66481fe44ec0b4926b262f9 Mon Sep 17 00:00:00 2001 From: p0ps Date: Wed, 22 Jul 2020 19:45:58 +0200 Subject: [PATCH] Add feature to enable checking all checkboxes of a grouped table (#703) * Add feature to enable checking all checkboxes of a grouped table's children. The checkbox is available in span/non-span mode in the vgt-header-row. * Option to Keep Rows Expanded in Grouped Tables (#704) * add row style class to header row * add logic to maintain expanded rows * add documentation * Check for the selectAllByGoup using the same 'typeof' as the others * Move @click for vgtExpand to span's with the triangle and the header label. * This, because if it's on the TR, it will also expand when the checkbox is clicked. * Update docs * Remove groupOptions. Maybe used it at some point, But not anymore. * Remove doc (rebase thing?) * Newline Co-authored-by: Rob Gaston --- dev/grouped-table.vue | 5 +- src/components/Table.vue | 24 +++++++++ src/components/VgtHeaderRow.vue | 66 +++++++++++++++++++----- vp-docs/guide/advanced/checkbox-table.md | 1 + 4 files changed, 83 insertions(+), 13 deletions(-) diff --git a/dev/grouped-table.vue b/dev/grouped-table.vue index e8b1ca15..f32f8934 100644 --- a/dev/grouped-table.vue +++ b/dev/grouped-table.vue @@ -6,7 +6,10 @@ :columns="columns" :rows="rows" :line-numbers="true" - :select-options="{enabled: true}" + :select-options="{ + enabled: true, + selectAllByGroup: true + }" @on-select-all="onSelectAll" @on-search="onSelectAll" @on-row-mouseenter="onMouseover" diff --git a/src/components/Table.vue b/src/components/Table.vue index e37051fb..291ed84a 100644 --- a/src/components/Table.vue +++ b/src/components/Table.vue @@ -155,12 +155,15 @@ :columns="columns" :line-numbers="lineNumbers" :selectable="selectable" + :select-all-by-group="selectAllByGroup" :collapsable="groupOptions.collapsable" :collect-formatted="collectFormatted" :formatted-row="formattedRow" :class="getRowStyleClass(headerRow)" :get-classes="getClasses" :full-colspan="fullColspan" + :groupIndex="index" + @on-select-group-change="toggleSelectGroup($event, headerRow)" >