I'm very clueless on this error. Here is my scenario, every time the user selects a value on the combobox, I needed to repopulate the treeview. The error is "setDataSource is not a function".
//populate tree view base on the site selected
var params = new Object();
params.siteid = site.value();
var jsondata = $.param(params);
$.ajax({
type: "GET",
url: "/Maintenance/ProjectFolderListBySite",
data: jsondata,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
var nodes = $.parseJSON(result.d);
var ds = new kendo.data.HierarchicalDataSource({
data: nodes,
schema: {
model:
{
id:"id",
parentid:"ParentID",
name:"Name",
siteid:"SiteID",
hasChildren:"hasChildren",
detailfolder:"DetailFolder"
}
}
});
$("#treeview").data("kendoTreeView").setDataSource(ds);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
//populate tree view base on the site selected
var params = new Object();
params.siteid = site.value();
var jsondata = $.param(params);
$.ajax({
type: "GET",
url: "/Maintenance/ProjectFolderListBySite",
data: jsondata,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
var nodes = $.parseJSON(result.d);
var ds = new kendo.data.HierarchicalDataSource({
data: nodes,
schema: {
model:
{
id:"id",
parentid:"ParentID",
name:"Name",
siteid:"SiteID",
hasChildren:"hasChildren",
detailfolder:"DetailFolder"
}
}
});
$("#treeview").data("kendoTreeView").setDataSource(ds);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});