Is it possible to sort/order scheduler groups
for example when I group resources with team property, the groups always gets sorted Alphabetically.
I want to be able to group and order the groups depending on the user's choice something like
D B Z C A, not sorting the resources themselves, in my case the poeple
To trigger custom sorting programmatically, you can use the group method on the store associated with the scheduler. You can call this method in response to an event, such as a button click or any other user interaction. Here's an example:
// Assuming you have a reference to the scheduler instance
const scheduler = ...; // Your scheduler instance
// Function to apply custom group sorting
function applyCustomGroupSorting() {
scheduler.store.group({
field: 'team',
fn: (a, b) => {
const order = ['D', 'B', 'Z', 'C', 'A'];
return order.indexOf(a.team) - order.indexOf(b.team);
}
});
}
// Example: Trigger sorting on a button click
document.getElementById('sortButton').addEventListener('click', applyCustomGroupSorting);
This way, you can control when the sorting is applied based on user actions.