From 0d68f79124bd69d535ebe49063ad2b720b829d5c Mon Sep 17 00:00:00 2001 From: Akshay Anand Date: Sun, 28 Mar 2021 13:56:44 -0400 Subject: [PATCH] fixes #834, fixes #788 - fix grouped row while filtering --- dev/App.vue | 187 +++++++++++++++++++-------------------- dev/grouped-table.vue | 4 +- src/components/Table.vue | 2 +- 3 files changed, 96 insertions(+), 97 deletions(-) diff --git a/dev/App.vue b/dev/App.vue index c9760afb..403fe23d 100644 --- a/dev/App.vue +++ b/dev/App.vue @@ -60,7 +60,7 @@ export default { perPage: 3, perPageDropdown: [3, 5, 10, 200, 300, 500, 1000], perPageDropdownEnabled: true, - infoFn: (params) => `alala ${params.firstRecordOnPage} to ${params.lastRecordOnPage} of ${params.totalRecords}`, + // infoFn: (params) => `alala ${params.firstRecordOnPage} to ${params.lastRecordOnPage} of ${params.totalRecords}`, }, columns: [ { @@ -143,99 +143,98 @@ export default { }, } ], - rows: [], - // rows: [ - // // { id:1, name:"John", age: 20, createdAt: '2018-02-18T00:00:43-05:00',score: 0.03343 }, - // { - // id: 2, - // name: 'Jane', - // age: 24, - // createdAt: '2011-10-31', - // score: 0.03343, - // bool: true, - // exact: 'match', - // average: 1 - // }, - // { - // id: 3, - // name: 'Angel', - // age: 16, - // createdAt: '2011-10-30', - // score: 0.03343, - // bool: true, - // exact: 'match', - // average: null - // }, - // { - // id: 4, - // name: 'Chris', - // age: 55, - // createdAt: '2011-10-11', - // score: 0.03343, - // bool: false, - // exact: null - // }, - // { - // id: 5, - // name: 'Dan', - // age: 40, - // createdAt: '', - // score: 0.03343, - // bool: null, - // exact: 'rematch', - // average: 2 - // }, - // { - // id: 5, - // name: '193.23', - // age: 20, - // createdAt: null, - // score: 0.03343, - // bool: null, - // exact: 'rematch', - // average: 3 - // }, - // { - // id: 5, - // name: 'Dan', - // age: 34, - // createdAt: null, - // score: 0.03343, - // bool: null, - // exact: null, - // average: 2 - // }, - // { - // id: 6, - // name: 'John', - // age: 20, - // createdAt: '2011-10-31', - // score: 0.03343, - // bool: true, - // exact: 'match', - // average: 1.5 - // }, - // { - // id: 7, - // name: 'Ángel', - // age: 20, - // createdAt: '2013-09-21', - // score: null, - // bool: 'false', - // exact: null, - // average: 1 - // }, - // { - // id: 8, - // name: 'Susan', - // age: 16, - // createdAt: '2013-10-31', - // score: 0.03343, - // bool: true, - // exact: 'rematch', - // average: 1 - // }, - // ], + rows: [ + // { id:1, name:"John", age: 20, createdAt: '2018-02-18T00:00:43-05:00',score: 0.03343 }, + { + id: 2, + name: 'Jane', + age: 24, + createdAt: '2011-10-31', + score: 0.03343, + bool: true, + exact: 'match', + average: 1 + }, + { + id: 3, + name: 'Angel', + age: 16, + createdAt: '2011-10-30', + score: 0.03343, + bool: true, + exact: 'match', + average: null + }, + { + id: 4, + name: 'Chris', + age: 55, + createdAt: '2011-10-11', + score: 0.03343, + bool: false, + exact: null + }, + { + id: 5, + name: 'Dan', + age: 40, + createdAt: '', + score: 0.03343, + bool: null, + exact: 'rematch', + average: 2 + }, + { + id: 5, + name: '193.23', + age: 20, + createdAt: null, + score: 0.03343, + bool: null, + exact: 'rematch', + average: 3 + }, + { + id: 5, + name: 'Dan', + age: 34, + createdAt: null, + score: 0.03343, + bool: null, + exact: null, + average: 2 + }, + { + id: 6, + name: 'John', + age: 20, + createdAt: '2011-10-31', + score: 0.03343, + bool: true, + exact: 'match', + average: 1.5 + }, + { + id: 7, + name: 'Ángel', + age: 20, + createdAt: '2013-09-21', + score: null, + bool: 'false', + exact: null, + average: 1 + }, + { + id: 8, + name: 'Susan', + age: 16, + createdAt: '2013-10-31', + score: 0.03343, + bool: true, + exact: 'rematch', + average: 1 + }, + ], }; }, methods: { diff --git a/dev/grouped-table.vue b/dev/grouped-table.vue index 18c912b3..1f665efe 100644 --- a/dev/grouped-table.vue +++ b/dev/grouped-table.vue @@ -8,7 +8,7 @@ :line-numbers="true" :select-options="{ enabled: true, - selectAllByGroup: true + selectAllByGroup: true, }" @on-select-all="onSelectAll" @on-search="onSelectAll" @@ -18,7 +18,7 @@ enabled: true, }" :pagination-options="{ - enabled: true, + enabled: false, perPage: 5, }" :group-options="{ diff --git a/src/components/Table.vue b/src/components/Table.vue index e56ef42f..d7e70f83 100644 --- a/src/components/Table.vue +++ b/src/components/Table.vue @@ -1400,7 +1400,7 @@ export default { } } } - this.filteredRows = computedRows; + this.filteredRows = computedRows.filter((h) => h.children && h.children.length); }, getCurrentIndex(rowId) {