本文介绍了jquery完整日历:回调“之后”日历已完全加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Adam Shaw的jquery完整日历中有回调吗?在日历完全呈现之后调用?我想调用clientEvents函数在该回调中获取客户端上的所有事件。我试着在viewDisplay中这样做,但是在事件呈现之前调用它,并且clientEvents返回0个事件。
Is there a callback in Adam Shaw's jquery full calendar which is called after the calendar has rendered completely?? I want to call the clientEvents function in that call back to get all the events on the client side. I tried doing this in viewDisplay, but it is called before the events are rendered and the clientEvents returns 0 events.
推荐答案
可以自己添加。更新 fullcalendar.js
中的函数 render
就像这样
Actually you can add it by yourself. Update the function render
in the fullcalendar.js
like this
function render(inc) {
if (!content) {
initialRender();
trigger('complete', null, true);
}else{
calcSize();
markSizesDirty();
markEventsDirty();
renderView(inc);
trigger('complete', null, true);
}
}
并添加到初始调用回调函数:
And add to the initial call callback function:
$('#calendar').fullCalendar({
editable: true,
complete: function() {alert('complete');},
complete: function() {
var events = $(this).fullCalendar('clientEvents');
for(var i in events)
{
alert(events[i].title);
}
},
这篇关于jquery完整日历:回调“之后”日历已完全加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!