Hi Kendo team,
I have a problem with reading the datasource.
data = new kendo.data.HierarchicalDataSource({
//----i am using this one---
//transport: {
// read: function (options) {
// $.ajax({
// url: '/Inventory/GetcategoryTree',
// type: "GET",
// dataType: "json"
// });
// }
//},
//-----or this one------
transport: {
read: {
url: function () {
return '/Inventory/GetcategoryTree';
},
create: {
dataType: "json",
type: "GET",
cache: true
}
}
},
schema: {
model: {
id: "Id",
children: "Children"
}
},
scrollable: true,
sort: { field: "CategoryName", dir: "desc" }
});
Then i add the DS to the tree:
var treeView = $("#treeview").kendoTreeView({
dataSource: data,
scrollable: true,
dataTextField: "CategoryName",
select: function (e) {
this.expand(e.node);
}
}).data("kendoTreeView");
So now the problem is, when i call the treeView.dataSource.read() nothing happens and in debugger i see that the read() is undefined.(cant see it in the list of methods too)
Do you guys now when this ca occur, and under what circumstances. Is it the HierarchicalDataSource? I can see that the data source is there and i see the data too. However on break point in Chrome the dataSource is "B.extend.init"
I have a problem with reading the datasource.
data = new kendo.data.HierarchicalDataSource({
//----i am using this one---
//transport: {
// read: function (options) {
// $.ajax({
// url: '/Inventory/GetcategoryTree',
// type: "GET",
// dataType: "json"
// });
// }
//},
//-----or this one------
transport: {
read: {
url: function () {
return '/Inventory/GetcategoryTree';
},
create: {
dataType: "json",
type: "GET",
cache: true
}
}
},
schema: {
model: {
id: "Id",
children: "Children"
}
},
scrollable: true,
sort: { field: "CategoryName", dir: "desc" }
});
Then i add the DS to the tree:
var treeView = $("#treeview").kendoTreeView({
dataSource: data,
scrollable: true,
dataTextField: "CategoryName",
select: function (e) {
this.expand(e.node);
}
}).data("kendoTreeView");
So now the problem is, when i call the treeView.dataSource.read() nothing happens and in debugger i see that the read() is undefined.(cant see it in the list of methods too)
Do you guys now when this ca occur, and under what circumstances. Is it the HierarchicalDataSource? I can see that the data source is there and i see the data too. However on break point in Chrome the dataSource is "B.extend.init"