Skip to content

Commit

Permalink
Handle changes in sort field or order
Browse files Browse the repository at this point in the history
- also created convenience method watcherUpdateLiveAndDelayed
  • Loading branch information
richard-cox committed Aug 1, 2022
1 parent ce939a2 commit 6d20772
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions shell/components/SortableTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -333,22 +333,24 @@ export default {
this.searchQuery = q;
}, 200),
descending(neu, old) {
this.watcherUpdateLiveAndDelayed(neu, old);
},
sortFields(neu, old) {
this.watcherUpdateLiveAndDelayed(neu, old);
},
groupBy(neu, old) {
if (neu !== old) {
this.$nextTick(() => this.updateLiveAndDelayed());
}
this.watcherUpdateLiveAndDelayed(neu, old);
},
namespaces(neu, old) {
if (neu !== old) {
this.$nextTick(() => this.updateLiveAndDelayed());
}
this.watcherUpdateLiveAndDelayed(neu, old);
},
page(neu, old) {
if (neu !== old) {
this.$nextTick(() => this.updateLiveAndDelayed());
}
this.watcherUpdateLiveAndDelayed(neu, old);
},
// Ensure we update live and delayed columns on first load
Expand Down Expand Up @@ -575,6 +577,12 @@ export default {
}
},
watcherUpdateLiveAndDelayed(neu, old) {
if (neu !== old) {
this.$nextTick(() => this.updateLiveAndDelayed());
}
},
updateLiveAndDelayed() {
if (this.hasLiveColumns) {
this.updateLiveColumns();
Expand Down

0 comments on commit 6d20772

Please sign in to comment.