每日专栏(Dojo 工具包 dojox.Calendar)
Columns in a Day (Dojo Toolkit dojox.Calendar)
我对 dojox.calendar 功能有疑问。简而言之,我正在尝试将 "day" 作为 dateInterval 的子列放入日历中。我已阅读并尝试了以下 link :http://livedocs.dojotoolkit.org/dojox/calendar#sub-columns
colView.set("store", new Memory({data:[
{
summary: "My Event",
startTime: new Date(2013, 0, 1, 10, 0),
endTime: new Date(2013, 0, 1, 14, 0),
calendar: "cal1"
}
]})**)**;
colView.set("subColumns", ["cal1", "cal2"]);
我的虚拟代码在这里
function(parser, ready, Calendar, Observable, Memory, Deferred, ColumnView, ColumnViewSecondarySheet) {
ready(function() {
someData = [{
id: 0,
summary: "Default Work",
begin: new Date(2016, 0, 1, 10, 0),
end: new Date(2016, 0, 1, 12, 0)
}];
calendar = new Calendar({
date: new Date(2007, 10, 21),
startTimeAttr: "begin",
endTimeAttr: "end",
store: new Observable(new Memory({
data: someData
})),
dateInterval: "month",
style: "position:relative;width:750px;height:500px"
}, "someId");
var colView = calendar.columnView;
colView.set("subColumns", ["cal1", "cal2"]);
colView.set("store", new Memory({
data: [{
summary: "My Event",
startTime: new Date(2007, 10, 21, 10, 0),
endTime: new Date(2007, 10, 21, 11, 0),
calendar: "cal1"
}]
}));
)
}
在结果中,它显示了一天中的子栏,但我无法将我的事件放置到这些子栏中 The screenshot from dummy code
我该如何解决这个问题?
感谢您的帮助,对不起我的英语。
日期 属性 设置为 2007 年,而您的数据反映的是 2016 年的日期。
此外,由于您更改了 startTimeAttr 和 endTimeAttr。您的数据应相应反映。
function(parser, ready, Calendar,Observable,Memory,Deferred,ColumnView,ColumnViewSecondarySheet){
ready(function(){
someData = [
{
id: 0,
summary: "Default Work",
begin: new Date(2016, 0, 1, 10, 0),
end: new Date(2016, 0, 1, 12, 0)
}
];
calendar = new Calendar({
date: new Date(2007, 10, 21),
startTimeAttr: "begin",
endTimeAttr: "end",
store: new Observable(new Memory({data: someData})),
dateInterval: "month",
style: "position:relative;width:750px;height:500px"
}, "someId");
var colView = calendar.columnView;
colView.set("subColumns", ["cal1", "cal2"]);
colView.set("store", new Memory({data:[
{
summary: "My Event",
begin: new Date(2007, 10, 21, 10, 0),
end: new Date(2007, 10, 21, 11, 0),
calendar: "cal1"
}
]}));
)}
我对 dojox.calendar 功能有疑问。简而言之,我正在尝试将 "day" 作为 dateInterval 的子列放入日历中。我已阅读并尝试了以下 link :http://livedocs.dojotoolkit.org/dojox/calendar#sub-columns
colView.set("store", new Memory({data:[
{
summary: "My Event",
startTime: new Date(2013, 0, 1, 10, 0),
endTime: new Date(2013, 0, 1, 14, 0),
calendar: "cal1"
}
]})**)**;
colView.set("subColumns", ["cal1", "cal2"]);
我的虚拟代码在这里
function(parser, ready, Calendar, Observable, Memory, Deferred, ColumnView, ColumnViewSecondarySheet) {
ready(function() {
someData = [{
id: 0,
summary: "Default Work",
begin: new Date(2016, 0, 1, 10, 0),
end: new Date(2016, 0, 1, 12, 0)
}];
calendar = new Calendar({
date: new Date(2007, 10, 21),
startTimeAttr: "begin",
endTimeAttr: "end",
store: new Observable(new Memory({
data: someData
})),
dateInterval: "month",
style: "position:relative;width:750px;height:500px"
}, "someId");
var colView = calendar.columnView;
colView.set("subColumns", ["cal1", "cal2"]);
colView.set("store", new Memory({
data: [{
summary: "My Event",
startTime: new Date(2007, 10, 21, 10, 0),
endTime: new Date(2007, 10, 21, 11, 0),
calendar: "cal1"
}]
}));
)
}
在结果中,它显示了一天中的子栏,但我无法将我的事件放置到这些子栏中 The screenshot from dummy code 我该如何解决这个问题?
感谢您的帮助,对不起我的英语。
日期 属性 设置为 2007 年,而您的数据反映的是 2016 年的日期。
此外,由于您更改了 startTimeAttr 和 endTimeAttr。您的数据应相应反映。
function(parser, ready, Calendar,Observable,Memory,Deferred,ColumnView,ColumnViewSecondarySheet){
ready(function(){
someData = [
{
id: 0,
summary: "Default Work",
begin: new Date(2016, 0, 1, 10, 0),
end: new Date(2016, 0, 1, 12, 0)
}
];
calendar = new Calendar({
date: new Date(2007, 10, 21),
startTimeAttr: "begin",
endTimeAttr: "end",
store: new Observable(new Memory({data: someData})),
dateInterval: "month",
style: "position:relative;width:750px;height:500px"
}, "someId");
var colView = calendar.columnView;
colView.set("subColumns", ["cal1", "cal2"]);
colView.set("store", new Memory({data:[
{
summary: "My Event",
begin: new Date(2007, 10, 21, 10, 0),
end: new Date(2007, 10, 21, 11, 0),
calendar: "cal1"
}
]}));
)}