This is our code.
we are catching events in HTML with "onCatchAll".
resourceFIlter is working base on 'trigger' used in function 'setupResourceFilter'
Support Forum
- Attachments
-
- New folder.7z
- (12.08 KiB) Downloaded 17 times
Glad the hint helped.
I noticed a few things.
Typo. I assume this should be translationPipe
:
These settings are irrelevant in MonthView or AgendaView. They shows whole day cells. These settings are all DayView things (Don't forget that a WeekView is just a multi day DayView):
Here is your bug I think:
You inject a trigger
method into the widget. This overrides the broadcasting of events, and therefore disables all event broadcasting.
This will break how filtering works. Nobody can subscribe to its events. Never override the trigger
method. Add a listener
:
this.sidebar.items.resourceFilter = {
type: 'calensoresourcefilter',
weight: 300,
selected: {
values: selectedValues
},
multiSelect: true,
// Listen for the item action
listeners : {
item({ source, record }) {
// Does the resourceFilter (source is the event broadcaster) have this record selected?
const isSelected = source.selected.includes(record);
}
}
I changed it in the example. Notice how the events filter out, but the resource subview stays:
If you configure the resourceFilter with selectAllItem : true
it of course keeps it synced. You do not need to intervene:
It obviously does this automatically. See the example: https://bryntum.com/products/calendar/examples/resourceview/
It would be a bad bug on our part if we did not do this.