我想要覆盖完整日历中的事件呈现功能。我的情况就像我有两个js文件,在一个父js文件中,我创建了一个日历,而在子js文件中,我想使用子js文件呈现事件。那么有没有什么方法可以从子js文件中覆盖完整日历的事件呢?这是我在父js中的完整日历的eventRender函数的代码。
eventRender: function(event, element) {
$(element).children().addClass("fc-event-inner-"+event.statusId);
$(element).children().attr("id",event.id);
setEventColor(element, _statusIdToEventBackgroundColor[event.statusId],_statusIdToEventFontColor[event.statusId]);
createContextMenu(event.statusId);
}这是子文件的代码
$(_panel).fullCalendar( 'renderEvent',loadedEvents, true);子文件中的此函数调用父文件的eventRender函数。我的日历在父Js文件中就像是虚拟的。因为我想从子Js文件中获取所有事件的控制和绑定。有没有可能在子js中创建或使用父类的函数(EventRender),或者如何通过创建对象来访问它。
感谢你的帮助。谢谢。
发布于 2012-10-26 00:20:02
看起来您可以将js函数添加到该函数的事件呈现部分。请参阅他们将qTip插件添加到事件中的示例here。
https://stackoverflow.com/questions/12725243
复制相似问题