Hi,
I am trying to implement custom sort operations on Grid. I am using external paging component and all the data adding and sorting will be done on outside the grid.
What I need is a sorting feature of data. The grid should not do the sorting on the current dataset it's store has, but still have the sorting indicators work like normal. So basically I want to prevent the sort actions happening on rows, but the sorting icons can stay.
I tried the following code, the listeners work and I can log the changes, but is there a way to prevent the sorting happening on the listener callback-methods? Also tried to replace the default sorter function in sorters array, but the method doesnt seem to work?
this.store = new Store({
listeners: {
beforeSort({ sorters }) {
console.log('beforeSort', sorters); // This logs fine, can I prevent the sort here?
},
sort({ sorters }) {
console.log('sorters', sorters); // or here?
},
},
sorters: [
{
fn: (o1, o2) => {
console.log('sorterFn'); // This doesn't log when sorting happens. Why?
return 0;
},
},
],
});