I'm trying to get a HierarchicalDataSource from my server, but I need to pass in specific values. I can't figure out how it's done and have tried following DataSource's documentation.
It breaks when it tries the .read(). When I specify "read" it says "TypeError: Illegal invocation ", when I specify "create" it says "Cannot read property 'data' of undefined ".
I'm currently doing:
var param1= ...;
var param2 = ...;
var dataSource = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "/Home/GetStuff",
dataType: "json",
data: { param1: param1, param2: param2 }
}
},
schema: {
model: { id: "id", hasChildren: "hasChildren", children: "items" }
}
});
dataSource.read();
My server method is public ActionResult GetStuff(Guid param1, Guid param2)
As per DataSource's docs, I tried using "create", as well as trying create: function(options) {... .ajax... }.
It breaks when it tries the .read(). When I specify "read" it says "TypeError: Illegal invocation ", when I specify "create" it says "Cannot read property 'data' of undefined ".
I'm currently doing:
var param1= ...;
var param2 = ...;
var dataSource = new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "/Home/GetStuff",
dataType: "json",
data: { param1: param1, param2: param2 }
}
},
schema: {
model: { id: "id", hasChildren: "hasChildren", children: "items" }
}
});
dataSource.read();
My server method is public ActionResult GetStuff(Guid param1, Guid param2)
As per DataSource's docs, I tried using "create", as well as trying create: function(options) {... .ajax... }.