Skip to content

Commit

Permalink
fix: fix empty table when click "remove all columns" just after page …
Browse files Browse the repository at this point in the history
…open
  • Loading branch information
popstas committed Mar 24, 2024
1 parent f375ad9 commit d92dd1f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -775,14 +775,23 @@ export default {
// устанавливает поля по массиву имен, сбрасывает предыдущие выбранные поля
setFields(columnNames) {
const fields = [];
// console.log('fields: ', fields);
// console.log('setFields: ', columnNames);
columnNames = _.uniq(columnNames);
for(let name of columnNames) {
const field = this.availableFields.find(field => field.name == name);
if (field) fields.push(field);
}
// console.log('fields: ', fields);
this.$store.commit("fields", fields);
// hack for correct table display just after open report and click "remove all columns"
if (fields.length === 1) {
this.$store.commit("fields", []);
setTimeout(() => {
this.$store.commit("fields", fields);
}, 10)
}
// this.updateUrlQuery();
},
Expand Down

0 comments on commit d92dd1f

Please sign in to comment.