所以我想使用FullCalendar和jQuery UI对话框。 我不确定如何去把这两个放在一起很好。FullCalendar在jQuery UI模式对话框中加载外部文件
当我选择或点击空白事件时,我想要弹出jQuery模态对话框。尽管我想让它加载一个内部文件(php include)。但与此相关的是,我无法让它关闭对话框,当我得到提交表格
此外,通过使用此方法,我不能让它拉我点击的日期自动填写开始日期字段。
什么是最好的路线去混合jQuery UI模式与fullCalendar对话框?
任何帮助,将不胜感激。如果可能,通过加载外部文件是否有一个好的方法?
这是目前我有:
select: function(start, end, date, allDay, jsEvent, view, calEvent) {
$("#addEventDialog").dialog("open");
$("#addEventDialog").load('dialog.CalendarNewEvent.php').dialog({
title: 'Add Event',
modal: true,
buttons: {
"Save": function() {
$("#calendarWidget2").ajaxSubmit({
target: "#calendarResponse",
dataType: 'json',
clearForm: true,
success: function(response, event) {
//If the widget says it's okay to refresh, refresh otherwise, consider it done
if(response.refreshEvents == '1') {
$("#calendar").fullCalendar("refetchEvents");
}
// Close the dialog box when it has saved successfully
$("#addEventDialog").dialog("destroy");
// Update the page with the reponse from the server
$("#calendarResponse").append("Successfully Added: "+ response.title +"<br />");
},
error: function() {
alert("Oops... Looks like we're having some difficulties.");
}
}); // Close ajax submit
},
"Cancel": function() { $(this).dialog("close"); }
}, //End buttons
});
//alert("The inputs will work if i un-comment this alert");
/* UPDATE ALL THE VALUES IN THE DIALOG BOX */
$("#startDate").val($.fullCalendar.formatDate(start, 'yyyy/MM/dd'));
$("#endDate").val($.fullCalendar.formatDate(end, 'yyyy/MM/dd'));
},
所以像我的代码中提到,当我使用此代码,没有得到更新...但但是当我使用的警报功能我现在把它放在那里,并使它真正生活......输入值将因某种原因而得到更新。这就好像这个函数正在快速实现这些值的应用一样,所以当我将警报停在那里时,它就会工作......任何想法?
orolo,谢谢你的工作很不错,除了我遇到了一个小毛病似乎...我已经在我的问题上面添加了我的代码。我希望你能帮我解决这个问题。 – Justin 2010-09-13 22:46:50
嗯,我想到了这个问题,这是因为我正在使用.load()函数与jQuery对话框,而不是将代码嵌入到主页面中。没有什么大不了的,但是修正了它。如果有解决方案,听起来真棒! – Justin 2010-09-14 04:33:25
添加事件没有附加在日期框中...请帮助我 – Elankeeran 2011-06-29 18:42:18