我想用拖拽编辑fullcalendar.io资源的嵌套;滴有可能这样做吗。我的方法:
resourceRender: function(resource, cellEls) {
cellEls.draggable({ handle: ".icon-resize-vertical",
revert: true,
helper: "clone",
zIndex: 999,
snap: true,
opacity: 0.7
});
cellEls.droppable({
hoverClass: "ui-state-active",
drop: function( event, ui ) {
$( this ).css( "font-weight", "bolder" );
var childid = $(ui.draggable).closest("tr").attr("data-resource-id");
var childEl = $("#calendar").fullCalendar( 'getResourceById', childid );
var parentid = $( this ).closest("tr").attr("data-resource-id");
var parentEl = $("#calendar").fullCalendar( 'getResourceById', parentid );
childEl.parent = parentEl;
parentEl.children.push(childEl);
$('#calendar').fullCalendar('destroy');
$('#calendar').fullCalendar('render');
}
});
},
资源对象显示正确的子对象和父对象,但日历不会重新发布。
如果您销毁日历,您所做的更改将丢失。
在拖动结束时&放下,呼叫
$('#calendar').fullCalendar('refetchEvents');