In my calendar, at the start, I want to select only a specific resources.
For example, in the "filtering" demo (https://www.bryntum.com/examples/calendar/filtering/), I only want the resource "Arcady" to be checked, how do I do that?
Support Forum
- Attachments
-
- What I want when calendar is loaded
- listOfPersonsCorrect.png (6.42 KiB) Viewed 532 times
All you need is apply filter on eventStore after it loaded.
Please have a look at our online example: https://bryntum.com/examples/calendar/customized-resourcefilter/
It also changes the view of resourceFilter, so ignore that part. All the rest is exactly what you need.
See the listener on load
event.
All the best,
Alex
I've adapted the code from the example, but I have some issues.
In the minimal test case, you can see that resourceField value is never overwritten, event though I pass it a value.
Where did I go wrong?
- Attachments
-
- minimal test case.zip
- Test case (without bryntum files, you must add them in the bryntum folder)
- (2.62 KiB) Downloaded 49 times
I cannot understand what are you trying to achieve, tbh.
I see errors in console when I run your app
agenda.js:176 Uncaught TypeError: Cannot read properties of undefined (reading '_data')
at CollectionFilter.filterBy [as _filterBy]
Please describe what are you trying to achieve? I though you only need to change the initial state of resourceFilter, isn't it?
Try to use our code as a start point.
All the best,
Alex
It's now possible to configure the initial selection:
sidebar : {
items : {
resourceFilter : {
// Initially select resource IDs 2, 3 and 4
selected : [2, 3, 4]
}
}
}
See this example: https://bryntum.com/examples/calendar/resourceview/