Sorry if my question is an easy one.
I have a grid with a gantt that is working fine, but we want to make a modification to sort the data.
The sort need to be a combination of 2 properties of the data.
For testing purpose, i add a new column name "orderByfield" to see the result of the 2 properties together. I also add fill the property "sortable" with a function to sort the data.
columns:
[
{
text: ' ',
field: "orderByfield",
width: 20,
hidden: false,
renderer(things: { record: { originalData: { displayIndex: number, factoryId: number, name: string } } }) {
return things.record.originalData.factoryId + " " + things.record.originalData.displayIndex;
},
sortable: (rec1: any, rec2: any) => (rec1.factoryId + " " + rec1.displayIndex) < (rec2.factoryId + " " + rec2.displayIndex) ? -1 : 1,
},
As I read in the doc and forum, it's working when we click of the header.
But i didnt succeed to do the same thing when the form open for the first time.
i tried different thing without success.
Thanks for your help.