Our powerful JS Calendar component


Post by tdset »

We're using the Calendar with the Scheduler (additional license purchased for it), and - while in timeline mode, we'd like to "Select all events" shown by the Scheduler.

I found that there's a "selectionMode" setting which would display a checkbox against a specific Resource.

https://www.dropbox.com/s/xa4h95jjhahe0lk/Snipaste_2022-08-10_14-58-27.png?dl=0

The result would like this:

https://www.dropbox.com/s/bxgyur2d24qz69n/Snipaste_2022-08-10_15-00-25.png?dl=0

Do you know how could I achieve this?


Post by Animal »

You would add a checkcolumn to the columns definition of your scheduler mode, and on toggle, query the current row's record (which is the resource) for all its events, and use the API to select them.


Post by tdset »

thank you for the idea. I cannot find the API method to programatically select an event, can you point it out?


Post by tdset »

sorry, another question. Do you know how can I avoid to click twice to make the checkbox be selected?

https://www.dropbox.com/s/g1znjgnts6huvjz/Snipaste_2022-08-10_19-24-34.png?dl=0


Post by marcio »

Best regards,
Márcio


Post by marcio »

Regarding the clicking twice to check it behavior, it's actually a bug, I created a ticket to fix it https://github.com/bryntum/support/issues/5052

Best regards,
Márcio


Post by tdset »

Thank you Marcio, much appreciated for your help and for the ticket to fix that.
I managed to select events via

findByField

and then

selectEvent

did the trick.


Post by mats »

It works fine if there's a field to which the column maps that holds the checked/unchecked value.

What is happening is that the renderer is re-rendering that cell on change. It sets the checkbox's value to undefined because there's no field to get a value from. And undefined is casted to false, so it unchecks.

So simply add the data field you want represented by the check column and it'll work fine.


Post by mats »

PS. A quick way to select all events is to do

scheduler.selectedEvents = scheduler.eventStore.records

Post by tdset »

Thank you Mats

The checkbox works fine if I map it to a field, but when checked/unchecked it emits a "sync" event on the Resource. Is there any way to avoid doing this? We only expect sync on "events", not on Resources


Post Reply