I can't figure out what I am doing wrong with this.
Treeview code with inline dataSource defined - this works fine.
If I move the dataSource definition out to its own declaration:
and change the treeview to use the defined datasource:
The data is no longer displayed in the treeview. When I look at the call/response in firebug, the data is returned correctly.
What am I missing?
Thanks.
Treeview code with inline dataSource defined - this works fine.
var lobTv = $("#linesOfBusiness").kendoTreeView({ select: function (e) { var tree = this; var src = tree.dataItem(e.node); jobOwnerId = src.LobId; isParent = src.HasChildren; }, change: function (e) { appsDataSource.read(); }, dataSource: { transport: { read: { url: apiUrl + "Lob" } }, schema: { model: { id: "LobId", hasChildren: "HasChildren" } } }, loadOnDemand: false, dataTextField: "LobName" });If I move the dataSource definition out to its own declaration:
var lobDataSource = new kendo.data.DataSource({ transport: { read: { url: apiUrl + "Lob" } }, schema: { model: { id: "LobId", hasChildren: "HasChildren" } } });and change the treeview to use the defined datasource:
var lobTv = $("#linesOfBusiness").kendoTreeView({ select: function (e) { var tree = this; var src = tree.dataItem(e.node); jobOwnerId = src.LobId; isParent = src.HasChildren; }, change: function (e) { appsDataSource.read(); }, dataSource: lobDataSource, loadOnDemand: false, dataTextField: "LobName" });The data is no longer displayed in the treeview. When I look at the call/response in firebug, the data is returned correctly.
What am I missing?
Thanks.