EXT Scheduler - 无法创建视图预设
我正在尝试更改 EXT Scheduler 中的日历标题日期布局。我已经从客户标头演示中复制了代码部分,进行了一些更改,然后将其放入我的代码中。
问题是我得到“Sch.preset未定义”,我正在执行“Sch.preset.Manager.registerPreset("weekView", weekView);”。我不确定这是一个范围问题还是我是否完全丢失了一些代码。
Ext.onReady(function () {
var weekView = {
displayDateFormat : 'Y-m-d',
shiftIncrement : 1,
shiftUnit : "WEEK",
timeResolution : {
unit : "DAY",
increment : 1
},
headerConfig : {
bottom : {
unit : "DAY",
dateFormat : 'D d M'
},
middle: {
unit : "QUARTER",
renderer : function(start, end, cfg) {
var quarter = Math.floor(start.getMonth() / 3) + 1,
fiscalQuarter = quarter === 4 ? 1 : (quarter + 1);
return "" //Ext.String.format('FQ{0} {1}', fiscalQuarter, start.getFullYear() + (fiscalQuarter === 1 ? 1 : 0));
}
},
top : {
unit : "YEAR",
cellGenerator : function(viewStart, viewEnd) {
var cells = [];
// Simplified scenario, assuming view will always just show one US fiscal year
return [{
start : viewStart,
end : viewEnd,
header : 'Fiscal Year ' + (viewStart.getMonth() + 1)
}];
}
}
}
};
Sch.preset.Manager.registerPreset("weekView", weekView);
Sked.init();
});
I am attempting to change the calendar header date layout in EXT Scheduler. I've copied the section of code from the customer header demo, made a few changes, and dropped it into my code.
The problem is I get "Sch.preset is undefined", where I'm executing "Sch.preset.Manager.registerPreset("weekView", weekView);". I'm not sure of this is a scoping issue or whether I'm missing some code completely.
Ext.onReady(function () {
var weekView = {
displayDateFormat : 'Y-m-d',
shiftIncrement : 1,
shiftUnit : "WEEK",
timeResolution : {
unit : "DAY",
increment : 1
},
headerConfig : {
bottom : {
unit : "DAY",
dateFormat : 'D d M'
},
middle: {
unit : "QUARTER",
renderer : function(start, end, cfg) {
var quarter = Math.floor(start.getMonth() / 3) + 1,
fiscalQuarter = quarter === 4 ? 1 : (quarter + 1);
return "" //Ext.String.format('FQ{0} {1}', fiscalQuarter, start.getFullYear() + (fiscalQuarter === 1 ? 1 : 0));
}
},
top : {
unit : "YEAR",
cellGenerator : function(viewStart, viewEnd) {
var cells = [];
// Simplified scenario, assuming view will always just show one US fiscal year
return [{
start : viewStart,
end : viewEnd,
header : 'Fiscal Year ' + (viewStart.getMonth() + 1)
}];
}
}
}
};
Sch.preset.Manager.registerPreset("weekView", weekView);
Sked.init();
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
Try