Our pure JavaScript Scheduler component


Post by license »

Hi Team,

Grouping and sorting in scheduler seem to be interdependent. Sorting does not seem to work independent of grouping. If there is no grouping, sort does not work. Why is this? Can these 2 features be independent?

Example Snippet:

We are initializing listeners as below

self.scheduler.store.listeners = {

        sort:function (args) {

            self.SchedulerStore.schedulerStateData.sorters = args.sorters;   //set saved values

        },

        group:function (args) {

            self.SchedulerStore.schedulerStateData.groupers = args.groupers;     //set saved values

        }

    } 

And trying to update sorters programmatically as below does not trigger the listeners

self.scheduler.store.sorters = sortersArray;

but when groupers are assigned similarly, even sorter is working as expected

self.scheduler.store.groupers = groupersArray;

Please let us know how to eliminate this dependency and to progress further.


Post by marcio »

Hey license,

It's expected to work like that, you can't set sorters directly like you described, as you'll see in the documentation, sorters is a read-only property. So changing them directly would not trigger the listeners correctly.
https://www.bryntum.com/docs/scheduler/api/Core/data/mixin/StoreSort#property-sorters

On the other way, groupers aren't read-only, so changing like that will trigger the listeners.
https://www.bryntum.com/docs/scheduler/api/Core/data/mixin/StoreGroup#property-groupers

To trigger correctly the sort, you need to use addSorter or sort function.
https://www.bryntum.com/docs/scheduler/api/Core/data/mixin/StoreSort#function-addSorter
https://www.bryntum.com/docs/scheduler/api/Core/data/mixin/StoreSort#function-sort

Best regards,
Márcio


Post Reply