Hi,
I need to use the Scheduler with declarative initialization (data-* attributes). I have a datasource called myDataSource, which is of type SchedulerDataSource(), initialized like this in a TypeScript file:
var myDataSource = new kendo.data.SchedulerDataSource();
I am using the following code snippet in the *.cshtml file. The
data-date, data-editable and data-views attributes work as expected:
<div id="scheduler" data-role="scheduler" data-date="2015/1/7" data-editable="true"
data-views=["day","week","month"] data-bind="myDataSource"
/>
My schema should look like this:
schema: {
model: {
id: "projectId",
fields: {
projectId: { from: "ProjectId", type: "number" },
title: { from: "QuoterName", defaultValue: "No title"},
start: { type: "date", from: "BidDate", defaultValue: "2015/1/7" },
end: { type: "date", from "BidDate", defaultValue: "2015/1/7" },
description: { from: "JobName" }
}
}
}
The "from" above contains the exact field names in the class that retrieves from the database. Questions:
1. How would I declare the model attribute in the scheduler "div" tag above? Your online documentation shows
examples in a <script/> tag, but I need to use it declaratively (using data-* attributes).
2. What formats do the start and end (dates) need to be in? Our BidDate column returns 2015-01-08 12:00:00.0000000, for example. How should it be formatted for the start and end? For example, we have a standard 30-minute duration,
so 2015-01-08 12:00:00.0000000 would start at 12:00 pm and end at 12:30 pm on 2015-01-08. What date formats should be passed in?
3. Do all fields that are being returned need to be declared in the schema or only the ones that are being displayed?
Thanks!
I need to use the Scheduler with declarative initialization (data-* attributes). I have a datasource called myDataSource, which is of type SchedulerDataSource(), initialized like this in a TypeScript file:
var myDataSource = new kendo.data.SchedulerDataSource();
I am using the following code snippet in the *.cshtml file. The
data-date, data-editable and data-views attributes work as expected:
<div id="scheduler" data-role="scheduler" data-date="2015/1/7" data-editable="true"
data-views=["day","week","month"] data-bind="myDataSource"
/>
My schema should look like this:
schema: {
model: {
id: "projectId",
fields: {
projectId: { from: "ProjectId", type: "number" },
title: { from: "QuoterName", defaultValue: "No title"},
start: { type: "date", from: "BidDate", defaultValue: "2015/1/7" },
end: { type: "date", from "BidDate", defaultValue: "2015/1/7" },
description: { from: "JobName" }
}
}
}
The "from" above contains the exact field names in the class that retrieves from the database. Questions:
1. How would I declare the model attribute in the scheduler "div" tag above? Your online documentation shows
examples in a <script/> tag, but I need to use it declaratively (using data-* attributes).
2. What formats do the start and end (dates) need to be in? Our BidDate column returns 2015-01-08 12:00:00.0000000, for example. How should it be formatted for the start and end? For example, we have a standard 30-minute duration,
so 2015-01-08 12:00:00.0000000 would start at 12:00 pm and end at 12:30 pm on 2015-01-08. What date formats should be passed in?
3. Do all fields that are being returned need to be declared in the schema or only the ones that are being displayed?
Thanks!