[VUE 2] sorting by columns without first row
Posted: Mon Jul 25, 2022 3:08 pm
Hello
How can we use sort by columns for grid except first row?
Thanks
Hello
How can we use sort by columns for grid except first row?
Thanks
Hey Webethics,
You can achieve that using the custom sorter function like this
const grid = new Grid({
... Other configurations
store : {
sorters : [{
fn : (recordA, recordB) => {
const [store] = recordA.stores; // Get the store reference
const { first } = store; // Get the first register of the store
// If it's the first register, always put it in first place
if (first.id === recordB.id) {
return 1;
}
// apply custom logic, for example:
return recordA.name.localeCompare(recordB.name);
}
}]
},
https://www.bryntum.com/docs/grid/api/Grid/feature/Sort
https://www.bryntum.com/docs/grid/api/Core/data/Store#property-first