【发布时间】:2015-08-25 06:57:17
【问题描述】:
我使用事件 url 从数据库中检索事件,但事件未在 fullcalnder 中显示??
我的 Js 代码是
$('#inspectionCalendar').fullCalendar({
header: {
left: 'next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable: false,
eventLimit: true, // allow "more" link when too many events
events: '<?php echo base_url(); ?>inspections/inspections_record',
});
我的控制器动作是:
function inspections_record() {
echo "[
{
title: 'All Day Event',
start: '2015-08-01'
},
{
title: 'Long Event',
start: '2015-02-07'
},
{
id: 999,
title: 'Repeating Event',
start: '2015-08-09T16:00:00'
},
{
id: 999,
title: 'Repeating Event',
start: '2015-08-16T16:00:00'
},
{
title: 'Conference',
start: '2015-08-26'
},
{
title: 'Meeting',
start: '2015-08-25T10:30:00',
},
{
title: 'Lunch',
start: '2015-08-25T12:00:00'
},
{
title: 'Meeting',
start: '2015-08-25T14:30:00'
},
{
title: 'Happy Hour',
start: '2015-08-12T17:30:00'
},
{
title: 'Dinner',
start: '2015-08-12T20:00:00'
},
{
title: 'Birthday Party',
start: '2015-08-13T07:00:00'
},
{
title: 'Click for Google',
url: 'http://google.com/',
start: '2015-08-28'
}
],";
}
我的浏览器控制台显示响应,但事件未显示在日历中?
请帮帮我。
谢谢
【问题讨论】:
-
如果我的回答对你有帮助,请标记为回答。
-
研究在你的inspections_record()函数中使用Codeigniter echo json_encode(你的事件的数组对象)
标签: javascript php jquery codeigniter fullcalendar