當點擊該按鈕即可打開對話框。對話是一種接受價值的形式。當表單被保存時,您可以執行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