2017-06-15 47 views
0

我在fullcalendar上使用“listMonth”视图。当我在正常的议程中放置外部事件时,会触发事件'drop'和'eventReceive',但是当我在listview上放置一个事件时,它不会触发这些事件。有没有办法实现这一点?Fullcalendar - 在列表视图上拖放事件

+0

不,因为它只是事件列表,而不是网格。在拖动任何事件的事件之间没有空闲空间。为此使用议程或基本视图。 – ADyson

+0

这么认为,谢谢你的快速反应。 –

回答

0

可能不会有助于获取有用的数据,但如果您正在寻找一种方法来检测某个项目是否已放置在日历上,则可以使用jQuery可停止停止功能。

$(".item").draggable({ 
    //other details 
    stop:function(event, ui){ 
     //get a reference to the calendar 
     var calendar = $("#calendar"); 

     //get bounds 
     var bounds = [ 
      left:calendar.offset().left, 
      top:calendar.offset().top, 
      width:calendar.width(), 
      height:calendar.height() 
     ]; 

     //get coordinates 
     var x = event.pageX; 
     var y = event.pageY; 

     //check if in bounds 
     if (
     x >= bounds.left && 
     x <= bounds.left + bounds.width && 
     y >= bounds.top && 
     y <= bounds.top + bounds.height 
     ){ 
      //item has been dropped within 
     } 
    } 
}); 

不幸的是,jQuery没有确定您将它放到的项目的方法。

+0

感谢您的信息! –