Our powerful JS Calendar component


Post by longevo-florian »

Hi,

I added some custom comboboxes to the sidebar of our calendar, and everything is working fine so far. I am using the comboboxes to select clients & employees and to display their various events in my calendar.

However, I would now need to programmatically add an Item to the selection of the combobox, similar to how I would add Items to an NgModel. Is there any way to access the 'selection' list of the combobox in the sidebar?


Post by mats »

If you mean the resource filter widget, you can access it like to

calendar.sidebar.widgetMap

And inspect the selected resources:

calendar.sidebar.widgetMap.resourceFilter.selected

You can also "reach" your own extra widgets added to the sidebar through the Sidebar's https://bryntum.com/docs/scheduler/api/Core/widget/Container#property-widgetMap

(Just set ref on your widgets)


Post by Animal »

Just a note that as long as there is no name collision, the ref of any widget is propagated to the widgetMap of all ancestor containers.

So the reference should also be on the Calendar's widgetMap


Post by longevo-florian »

Thanks, I can find the widget in the calendars widget map.

However, when I look at the 'selected' value of the combobox, only the first selection is returned, even though multiselection is enabled. Is there any way I can see and manipulate all of the currently selected elements of the combobox widget?


Post by mats »

If you try this in the basic demo, you should see 3 selected records?

Attachments
Screenshot 2021-10-29 at 16.25.52.png
Screenshot 2021-10-29 at 16.25.52.png (191.09 KiB) Viewed 771 times

Post by longevo-florian »

It might work for the resourceFilter, but as we need to connect each event to a client and an employee we implemented custom comboboxes in the sidebar, that let you select clients and employees whose events shall be displayed. The selection of a new employee or client then results in a backend call which fetches the events for the selected time period.

Those comboboxes only return the first selection instead of all of them.

Maybe there is a better way to assign multiple entities to a single event?


Post by mats »


Post by longevo-florian »

Thanks!


Post Reply