Hey,
We are trying to have one row (containing the main events) from our scheduler always at the top, even when we sort. For that we need custom sorting.
Planner config:
{
[...]
sortFeature: true,
[...]
}
According to the docs (https://bryntum.com/docs/scheduler/api/Core/data/mixin/StoreSort) I should be able to do something like this:
instance.resourceStore.sort({
fn : (recordA: any, recordB: any) => {
console.log('recordA', recordA);
console.log('working...');
return recordA?.name?.length < recordB?.name?.length ? -1 : 1;
}
});
If I do this, my logs are not shown in the console and the (default) sorting still works.
If I do it like this:
instance.resourceStore.sort = (recordA: any, recordB: any) => {
console.log('recordA', recordA);
console.log('working...');
return recordA?.name?.length < recordB?.name?.length ? -1 : 1;
}
My logs DO show up in the console.
My recordA and recordB are not what I'd expect it to be.
The sorting does NOT work anymore, so I somehow did manage to override it.
Can you help me out here?
Kind regards,
Thomas Opdebeeck