0
想知道我怎么可以允许用户填写表格,而不是这似乎弹出promot框,当用户点击fullcalendar完整的日历不是通过promot添加事件
这是一个黑色部分基本上是我迄今为止所做的。正如你所看到的,我已经将数据发送到一个正在工作的PHP页面,但是我只是对提示框感到不满意,反而希望它成为一个很好的表单,以便他们能够添加注释。
select: function(start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent',
{
title: title,
start: start,
end: end,
allDay: allDay,
},
true // make the event "stick"
);
year = new Date(start).getFullYear();
month = new Date(start).getMonth()+1;
month = ((month < 10) ? '0' : '') + month;
day = ((new Date(start).getDate() < 10) ? '0' : '') + new Date(start).getDate();
hours = ((new Date(start).getHours() < 10) ? '0' : '') + new Date(start).getHours();
min = ((new Date(start).getMinutes() < 10) ? '0' : '') + new Date(start).getMinutes();
sec = ((new Date(start).getSeconds() < 10) ? '0' : '') + new Date(start).getSeconds();
start = year + '-' + month + '-' + day +' '+hours+':'+min+':'+sec;
year = new Date(end).getFullYear();
month = new Date(end).getMonth()+1;
month = ((month < 10) ? '0' : '') + month;
day = ((new Date(end).getDate() < 10) ? '0' : '') + new Date(end).getDate();
hours = ((new Date(end).getHours() < 10) ? '0' : '') + new Date(end).getHours();
min = ((new Date(end).getMinutes() < 10) ? '0' : '') + new Date(end).getMinutes();
sec = ((new Date(end).getSeconds() < 10) ? '0' : '') + new Date(end).getSeconds();
end = year + '-' + month + '-' + day +' '+hours+':'+min+':'+sec;
//alert(start+' - '+end);
$.get("system/classes/core.php?task=calendar&q=addnew&userid="+userid+"&title="+title+"&start="+start+"&end="+end+"&allDay="+allDay, function(data) {
alert(title + ' was created for '+ start +' '+ end);
});
}
calendar.fullCalendar('unselect');
},
感谢,并帮助我在正确的方向 – RussellHarrower 2012-01-15 22:25:22
一个小问题是,不发送开始和结束时间或如果它的全天事件 – RussellHarrower 2012-01-17 03:05:19
您需要将其添加到发布请求,通过start:start,end:end和allDay:allDay。 – 2012-01-17 03:10:24