gpt4 book ai didi

jquery - 如何在 fullcalendar jquery 插件中使用 EventOrder 属性

转载 作者:行者123 更新时间:2023-12-01 06:45:06 30 4
gpt4 key购买 nike

我想使用 fullcalendar jquery 插件的 eventOrder 属性,但我找不到任何如何设置该属性的示例。我添加了我想使用的非标准字段属性、描述。如何将此属性设置为 eventOrder?这是我的事件当前的显示方式:

$('#calendar').fullCalendar({
header:
{
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
titleFormat: {month: 'MMMM'},
defaultView: 'month',
events: function (start, end, timezone, callback) {
$.ajax({
type: "POST",
url: '@Url.Action("GetAllEvents", "Home")',
// data: "{'userID':'" + $('#<%= hidUserID.ClientID %>').val() + "'}", //this is what I use to pass who's calendar it is
//completely take out 'data:' line if you don't want to pass to webmethod - Important to also change webmethod to not accept any parameters
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (doc) {
var events = [];
$(doc).each(function () {
events.push({
title: $(this).attr('title'),
start: $(this).attr('start'),
end: $(this).attr('end'),
id: $(this).attr('id'),
description: $(this).attr('description')
});

});
callback(events);
} ,
error: function () {
alert("There was an error fetching events!")
}
});
},
eventRender: function (event, element) {
element.find('.fc-title').append("<br/>" + event.description);
},
//this is the problem...how to set the eventOrder?
eventOrder: ["description"]
}

最佳答案

首先,您需要确保您使用的是 FullCalendar v.2.4

然后,您需要删除“description”周围的括号“[ ]”。

eventOrder: "description"

检查这个 fiddle ,我按标题降序排序:http://jsfiddle.net/slyvain/waa23ry0/

关于jquery - 如何在 fullcalendar jquery 插件中使用 EventOrder 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32569886/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com