Skip to content

Commit

Permalink
fixes #834, fixes #788 - fix grouped row while filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis committed Mar 28, 2021
1 parent 91a890e commit 0d68f79
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 97 deletions.
187 changes: 93 additions & 94 deletions dev/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions dev/grouped-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:line-numbers="true"
:select-options="{
enabled: true,
selectAllByGroup: true
selectAllByGroup: true,
}"
@on-select-all="onSelectAll"
@on-search="onSelectAll"
Expand All @@ -18,7 +18,7 @@
enabled: true,
}"
:pagination-options="{
enabled: true,
enabled: false,
perPage: 5,
}"
:group-options="{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ export default {
}
}
}
this.filteredRows = computedRows;
this.filteredRows = computedRows.filter((h) => h.children && h.children.length);
},
getCurrentIndex(rowId) {
Expand Down

0 comments on commit 0d68f79

Please sign in to comment.