Hi Everyone,
I have following very simple code that works as expected.
Why do I not need to call ds.read() in this scenario?
And
If i replace the dataSource: ds with the commented block dataSource: {data: ds } no data is displayed at all. Any idea why?
Thanks for the help.
I have following very simple code that works as expected.
$(document).ready(function () {
var ds = null;
ds = new kendo.data.DataSource({
transport: {
read: {
url: "data.json", dataType: "json"
}
},
change: function () {
var data = this.data(); // or this.view();
}
});
$("#grid").kendoGrid({
dataSource: ds,
// dataSource: {
// data: ds,
// pageSize: 2
// },
sortable: {
mode: "single",
allowUnsort: false
},
columns: [
{
field: "Product",
title: "Product Title"
},
{
field: "Manufacturer",
title: "Manufacturer Title"
},
{
field: "Description",
title: "Description Title"
},
{
field: "Property2",
title: "Property 2"
}
]
});
});
And
If i replace the dataSource: ds with the commented block dataSource: {data: ds } no data is displayed at all. Any idea why?
Thanks for the help.