Hello,
I want to mass update the data of dataSource in JSON.
If you run in the following way, it seems well data is not set.
<!DOCTYPE html>
<
html
>
<
head
>
<
meta
charset
=
"utf-8"
>
<
title
>Kendo UI Snippet</
title
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.common.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.rtl.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.default.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.dataviz.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.dataviz.default.min.css"
>
<
link
rel
=
"stylesheet"
href
=
"http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.mobile.all.min.css"
>
<
script
src
=
"http://code.jquery.com/jquery-1.9.1.min.js"
></
script
>
<
script
src
=
"http://kendo.cdn.telerik.com/2015.3.930/js/kendo.all.min.js"
></
script
>
</
head
>
<
body
>
<
div
id
=
"gantt"
></
div
>
<
script
>
var dataSource =new kendo.data.GanttDataSource({
data: [
{
"id": 0,
"orderId": 0,
"parentId": null,
"title": "old task1",
"start": "2015-10-19",
"end": "2015-10-20"
},
{
"id": 1,
"orderId": 0,
"parentId": null,
"title": "old task2",
"start": "2015-10-19",
"end": "2015-10-20"
}
]
});
$("#gantt").kendoGantt({
dataSource: dataSource,
views: ["week"],
columns: [
{ field: "title", title: "Title" },
{ field: "id", title: "ID" }
]
});
dataSource.fetch(function(){
dataSource.data([
{
"id": 0,
"orderId": 0,
"parentId": null,
"title": "new task1",
"start": "2015-10-19",
"end": "2015-10-20"
},
{
"id": 1,
"orderId": 0,
"parentId": null,
"title": "new task2",
"start": "2015-10-19",
"end": "2015-10-20"
}
]);
});
</
script
>
</
body
>
</
html
>
Date is not displayed well as attached image.