I have a kendo tree which i am trying to bind it to a local json arrray.
Trying to map my json object properties to what treeView expects is not working.
The value of the "text" property is the function definition (function (item){ return item.Text; }
) The function itself doesn't gets evaluated
Html:
<div id="tree"></div>
Javascript:
var data = [
{
"Text": "Some dummy text"
}
];
var inlineDefault = new kendo.data.HierarchicalDataSource({
data: data,
schema: {
model: {
text: function(item){
return item.Text;
}
}
}
});
$("#tree").kendoTreeView({
dataSource: inlineDefault
});
Defining a schema model in this way is not supported - see the options here,the additional field for hierarchical data sources here and an example on how to create a tree view here.