ajax异步日历,ajax不能使用完整的日历

我已经使用full calendar外部拖动事件的主题分配接口。使用ajax更新主题的详细信息到MySQL数据库,但阿贾克斯不工作。我没有得到我的控制器中的值。检查其他问题,但没有找到解决办法。可以帮助吗?ajax不能使用完整的日历

$(document).ready(function() {

/* initialize the external events

-----------------------------------------------------------------*/

$('#external-events .fc-event').each(function() {

// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)

// it doesn't need to have a start or end

var eventObject = {

title: $.trim($(this).text()) // use the element's text as the event title

};

// store the Event Object in the DOM element so we can get to it later

$(this).data('eventObject', eventObject);

// make the event draggable using jQuery UI

$(this).draggable({

zIndex: 999,

revert: true, // will cause the event to go back to its

revertDuration: 0 // original position after the drag

});

});

/* initialize the calendar

-----------------------------------------------------------------*/

$('#calendar').fullCalendar({

header: {

left: 'prev,next today',

center: 'title',

right: 'month,agendaWeek,agendaDay'

},

editable: true,

droppable: true,

drop: function(date,event) {

// retrieve the dropped element's stored Event Object

var originalEventObject = $(this).data('eventObject');

// we need to copy it, so that multiple events don't have a reference to the same object

var copiedEventObject = $.extend({}, originalEventObject);

// assign it the date that was reported

copiedEventObject.start = date;

// render the event on the calendar

// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)

$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);

// is the "remove after drop" checkbox checked?

if ($('#drop-remove').is(':checked')) {

// if so, remove the element from the "Draggable Events" list

$(this).remove();

}

$.ajax({

url: '/addSchedule',

dataType: 'json',

type: 'post',

data: {event: event},

success: function(response){

console.log('response');

}

});

}

});

});

2014-11-08

AVM

+0

'这不是working'不正确的问题陈述。什么不起作用以及您遵循了哪些故障排除步骤? –

2014-11-08 18:45:53

+0

@charlietfl在完整日历上发生拖放事件时使用ajax保存事件详细信息,但ajax调用失败。我没有获得控制器 –

2014-11-08 18:54:50

+0

@AVM中的值,您是否在控制台中看到错误?此外,如果您将'error:function(jqXHR,textStatus,errorThrown){console.log(jqXHR)}'([请参阅文档](http://api.jquery.com/jquery.ajax/))添加到您的$ ajax调用,你看到一条错误消息吗? –

2014-11-09 16:44:48

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值