I added infinite scrolling to the grid and have a handler in the before sort to reload the data sorted .
private get bryntumStore(): Store {
const store: Store = new Store();
store.data = this.actionItems;
const boundedBeforeSort: (event: any) => Promise<void> = async (event: any) => {
this.loading = true;
console.log(event);
this.$refs.grid.gridInstance.scrollToTop();
this.sortBy = event.sorters[0].field;
this.ascending = event.sorters[0].ascending;
this.actionItems = await (this.dataGenerators[this.selectedTab].next()).value(
100,
this.sortBy,
this.ascending
);
this.loading = false;
return event;
}
store.on({
beforeSort: boundedBeforeSort
})
return store;
}
If I click the header and console log the event. inside the sorters object its ascending, ascending, descending, ascending, ascending, descending... For some reason it fires ascending on the first two clicks and I end up having to click the header three times to get it to sort descending. Is the changing of the store data during the before sort throwing everything off? Since I am doing infinite scroll I do not think I have the option of doing ajaxStore. Thanks for any help you can provide!