Fullcalendar Scheduler 5 以编程方式扩展资源组
Fullcalendar Scheduler 5 programmatically expand resource group
我正在使用 fullcalendar-Scheduler 5.2。
如何展开或折叠资源组?
我知道 resourcesInitiallyExpanded 函数,但我想 expand/collapse 一个特定的资源组。
我找到了一个例子:
https://codepen.io/anon/pen/odNOWZ?editors=0010 但这是针对旧版本的 Fullcalendar。
viewRender: function(view) {
$('#calendar .fc-divider .fc-cell-text').each(function(index, area_text_el) {
if (area_text_el.innerText === 'Auditorium A') {
$(area_text_el).siblings('.fc-expander').click()
}
})
我将使用 resourceGroupLabelDidMount 挂钩,它给我这个参数:
当上述钩子被指定为function(arg)形式的函数时,arg是一个具有以下属性的对象:
组值
el - 元素。仅在 resourceGroupLabelDidMount、resourceGroupLabelWillUnmount、resourceGroupLaneDidMount 和 resourceGroupLaneWillUnmount 中可用
但是在哪里可以调用点击函数呢?
谢谢!
好吧,我昨天就想到了(在一些尝试错误之后)
我就是这样做的:
resourceGroupLabelDidMount:function(info){
if(info.groupValue === 'Auditorium B'){
info.el.querySelector('.fc-datagrid-expander')
.click();
}
我正在使用 fullcalendar-Scheduler 5.2。
如何展开或折叠资源组? 我知道 resourcesInitiallyExpanded 函数,但我想 expand/collapse 一个特定的资源组。
我找到了一个例子: https://codepen.io/anon/pen/odNOWZ?editors=0010 但这是针对旧版本的 Fullcalendar。
viewRender: function(view) {
$('#calendar .fc-divider .fc-cell-text').each(function(index, area_text_el) {
if (area_text_el.innerText === 'Auditorium A') {
$(area_text_el).siblings('.fc-expander').click()
}
})
我将使用 resourceGroupLabelDidMount 挂钩,它给我这个参数:
当上述钩子被指定为function(arg)形式的函数时,arg是一个具有以下属性的对象:
组值
el - 元素。仅在 resourceGroupLabelDidMount、resourceGroupLabelWillUnmount、resourceGroupLaneDidMount 和 resourceGroupLaneWillUnmount 中可用
但是在哪里可以调用点击函数呢?
谢谢!
好吧,我昨天就想到了(在一些尝试错误之后)
我就是这样做的:
resourceGroupLabelDidMount:function(info){
if(info.groupValue === 'Auditorium B'){
info.el.querySelector('.fc-datagrid-expander')
.click();
}