我有很多活动都是全天活动,而且都是在同一时间开始的.我按照我希望它们出现在完整日历视图中的顺序创建事件,但它们似乎总是以其他方式排序.
如何按字母或按ID排序事件?
编辑:添加示例数据数组.在日历中,我预计Supervisor事件将每天首先出现,按照字母顺序出现在Tech1和Tech2之前,并且其id也是出租人数,而不是以下事件.相反,我每天都会收到一份随机订单.
例如:
2011-11-05的订单显示为Tech2,Tech1,Tech1,Tech1,Tech2,Supervisor.
2011-11-06的一天,该订单显示为主管,Tech1,Tech1,Tech1,Tech2,Tech2.
我要求排序至少每天都是一致的,理想情况是按标题的字母顺序排列,或者按照id的顺序排列.
var events=[
{id:1, title:'Supervisor',start:'2011-11-05T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:2, title:'Tech2',start:'2011-11-05T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:3, title:'Tech2',start:'2011-11-05T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:4, title:'Tech1',start:'2011-11-05T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:5, title:'Tech1',start:'2011-11-05T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:6, title:'Tech1',start:'2011-11-05T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:7, title:'Supervisor',start:'2011-11-06T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:8, title:'Tech2',start:'2011-11-06T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:9, title:'Tech2',start:'2011-11-06T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:10, title:'Tech1',start:'2011-11-06T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:11, title:'Tech1',start:'2011-11-06T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true},
{id:12, title:'Tech1',start:'2011-11-06T00:00:00-05:00',st_hours:10,ot_hours:0,allDay:true}
];
Run Code Online (Sandbox Code Playgroud)
EDIT2:此问题似乎只存在于Google Chrome中.事件按照我期望的顺序呈现在IE9和FF8中.我开发的Chrome 15似乎是唯一受影响的浏览器.
铬
火狐
