Skip to content

Commit

Permalink
fixes #822 - fix externalQuery duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis committed Mar 2, 2021
1 parent b8b572c commit afe09f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dev/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export default {
rowStyleClass: 'red',
searchTerm: '',
paginationOptions: {
enabled: false,
mode: 'records',
enabled: true,
perPage: 5,
perPageDropdown: [3, 50, 100, 200, 300, 500, 1000],
perPageDropdownEnabled: true,
Expand Down
10 changes: 6 additions & 4 deletions src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,8 @@ export default {
});
const filteredRows = [];
allRows.forEach((row) => {
this.columns.forEach((col) => {
for (let i = 0; i < this.columns.length; i += 1) {
const col = this.columns[i];
// if col does not have search disabled,
if (!col.globalSearchDisabled) {
// if a search function is provided,
Expand All @@ -778,7 +779,7 @@ export default {
);
if (foundMatch) {
filteredRows.push(row);
return false; // break the loop
break; // break the loop
}
} else {
// comparison
Expand All @@ -789,11 +790,11 @@ export default {
);
if (matched) {
filteredRows.push(row);
return false; // break loop
break; // break loop
}
}
}
});
}
});
// this is where we emit on search
Expand All @@ -808,6 +809,7 @@ export default {
this.filteredRows.forEach((headerRow) => {
const i = headerRow.vgt_header_id;
const children = filteredRows.filter((r) => r.vgt_id === i);
console.log(children);
if (children.length) {
const newHeaderRow = JSON.parse(JSON.stringify(headerRow));
newHeaderRow.children = children;
Expand Down

0 comments on commit afe09f3

Please sign in to comment.