Programmatically toggle resources
See original GitHub issueLooking through the issues I do not see this mentioned it anywhere, but it would be nice if you could programatically toggle a resource. This would probably work by either giving a resource ID to toggle just one or giving no ID to toggle all resources. Below is my proposal formatted like the docs.
toggleResource
Toggles a resource between the open/closed state.
.fullCalendar( 'toggleResource' [, idOrFilter [, state]] )
This method will toggle one or many resources between the opened/closed state depending on the filter and state parameter.
If idOrFilter is omitted, all resources will be toggled.
If idOrFilter is an ID, all resources with the same ID will be toggled.
idOrFilter may also be a filter function that accepts one Resource Object argument and returns true if it should be included in the result set.
State accepts two options, open
and close
, this will force the resources to either open or close.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:11 (8 by maintainers)
Top GitHub Comments
I just wrote a little function using fullcalendar api and the internal state to set the expanded state of all resources that met a certain criteria based in the resources extendedProps.
You can also get the current isExpanded state somewhere from the currentDataManager in the fullcalendarApi if needed.
Code is working fullcalendar/vue 5.9.0
You may be able to get better performance if you using batchRows/unbatchRows (internal functions) to defer dimension readjustment until the very end: