Our powerful JS Calendar component


Post by philipp.froebel »

Hi Bryntum Team,

i dry to sort a calendar ResourceStore unfortunately without success :-(

What i do is this

const project = new bryntum.calendar.ProjectModel({
                startDate: new Date().toISOString(),
                resourceStore: {
                    sorters: [{ field: "name", ascending: false }],
                    data: [
                        {
                            name: "a",
                            eventColor: "#ff0000"
                        },
                        {
                            name: "b",
                            eventColor: "#ccc"
                        }
                    ]
                }
            });

new bryntum.calendar.Calendar({
                minHeight: 525,
                height: '100%',
                resourceStore: project.resourceStore,

            // Start life looking at this date
            date: new Date(),

            dateFormat: 'DD.MM.YYYY',
            

            // This element becomes the Calendar's encapsulating element
            adopt: 'frn-calendar-container',

        });

The order of the resources is always a, b whether the sorter is { field: "name", ascending: false } or { field: "name", ascending: true }.

Please give me a help for sorting resources.

Tested with version 4.0.8 and 4.3.2

Thanks
Philipp


Post by Animal »

The creation of the ResourceStore is obeying:

Screenshot 2021-11-25 at 14.21.13.png
Screenshot 2021-11-25 at 14.21.13.png (68 KiB) Viewed 900 times

But the ResourceFilter in the Sidebar uses a chained store (basically a slave store, so that it does not affect the main resourceStore and the main resourceStore does not affect it)

It is configured to sort itself in ascending order.

You can configure it:

sidebar : {
    items : {
        resourceFilter : {
            store : {
                sorters : [{
                    ascending : false
                }]
            }
        }
    }
}

Post by philipp.froebel »

Hi Animal,

the sorting works now but only if configured the sorter on the resourceStore and also on sidebars chained store.

Thanks
Philipp


Post by Animal »

They are two separate stores.

If you want the Project's ResourceStore to begin sorted, you have to tell it.

If you want to override the default configuration which the resourceFilter applies to its slave store, you have to tell it.


Post by philipp.froebel »

Ok now it works with configured only the resourceFilter store.

thanks a lot
philipp


Post Reply