HI Team,
I have a Grid that is grouped by a string, but I would like to sort the groups by a number field on the same object. For my Grid, I want the column I set as the grouped column to be the only groupable column.
I have tried setting groupSortFn in my features computed property as well as using fn to sort in the grouper that I set in the store computed property. Can you advise?
The list object[] I provide to store.data has the fields: name: string, number: number, and a few others used in the bryntum columns.
Code for column:
private get bryntumColumns(): object[] {
const columns: object[] = [
{
id: 'name',
hidden: true,
field: 'name',
enableCellContextMenu: false,
groupRenderer({ groupRowFor, groupRecords }) {
return `${groupRowFor}`;
},
}
Code for store and feature
private get bryntumStore(): Store {
const store: Store = new Store();
store.data = this.list;
store.group('name');
return store;
}
private get bryntumGridFeatures(): any {
const gridFeatures: any = {
headerMenu : {
disabled: true,
},
};
return gridFeatures;
}
:
<bgrid
:readOnly="false"
:store="bryntumStore"
:columns="bryntumColumns"
:features="bryntumGridFeatures"
ref="grid">
</bgrid>