当点击该按钮即可打开对话框。对话是一种接受价值的形式。当表单被保存时,您可以执行jquery ajax调用以将其保存到存储中。
dayClick: function (date, allDay, jsEvent, view) {
$('#eventTitle').val("");
$('#eventDate').val($.fullCalendar.formatDate(date, 'dd/MM/yyyy'));
$('#eventTime').val($.fullCalendar.formatDate(date, 'HH:mm'));
ShowEventPopup(date);
},
function ShowEventPopup(date) {
$('#popupEventForm').modal('show');
$('#eventTitle').focus();
}
$('#btnPopupSave').click(function() {
$('#popupEventForm').hide();
var dataRow = {
'Title': $('#eventTitle').val(),
'NewEventDate': $('#eventDate').val(),
'NewEventTime': $('#eventTime').val(),
'NewEventDuration': $('#eventDuration').val()
}
ClearPopupFormValues();
$.ajax({
type: 'POST',
url: "/Diary/SaveEvent",
data: dataRow,
success: function (response) {
if (response == 'True') {
$('#calendar').fullCalendar('refetchEvents');
alert('New event saved!');
}
else {
alert('Error, could not save event!');
}
}
});
});
看看在asp.net这个解决方案MVC http://www.codeproject.com/Articles/638674/Full-calendar-A-complete-web-diary-system-for-jQue – 2015-04-05 09:01:43
实际上我不能使用任何对话框,我必须添加点击该('+')按钮的事件, function addEvent(date){ var newEvent = { title:timeSlot, start:date.format() }; } 这里的时隙是全局变量,其值由用户设置。 – nirux 2015-04-05 14:54:42