Fullcalendar - 在listview

时间:2017-06-15 11:35:16

标签: listview events fullcalendar droppable

我正在使用" listMonth"查看我的完整日历。当我将外部事件放在正常议程上时,事件会掉落。和' eventReceive'被触发,但是当我在列表视图上放下一个事件时,它不会触发这些事件。有没有办法实现这个目标?

1 个答案:

答案 0 :(得分:0)

可能在获取有用数据方面没有帮助,但如果您正在寻找一种方法来检测项目是否已在日历上删除,则可以使用jQuery droppable stop函数。

$(".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没有办法确定你放弃它的项目。

相关问题