javascript - KendoUI Treeview expand nodes based on value -


i have kenodui treeview trying expand top level nodes if have following values: "active" or "closed", remaining nodes can remain closed. using following code create treeview:

if (ci.popup.treeview == null) {         ci.popup.treeview = $("#relatedpropertylisting").kendotreeview({             template: "#= item.name #",             dataimageurlfield: "image",             datasource: ci.popup.treeds,             datatextfield: ["name", "name"],             encoded: true         }).data("kendotreeview");     } 

my datasource defined json kendo.data.hierarchicaldatasource. have tried generating treeview using html instead of datasource unbareably slow have use method.

any ideas how can expand nodes have value of "active" or "closed"???

thanks in advance help.

if can change returned data, can set expanded true each node want expanded , kendoui automatically take care of it.

example:

var data = [     {         text    : "node 1",         expanded: true,         items   : [             { text: "node 1.1" },             {                 text    : "node 1.2",                 expanded: false,                 items   : [                     { text: "node 1.2.1" },                     { text: "node 1.2.2" },                     { text: "node 1.2.3" }                 ]             },             { text: "node 1.3" }         ]     } ];  var treeview = $("#treeview-left").kendotreeview({     datasource  : data,     loadondemand: true }).data("kendotreeview"); 

jsfiddle in here


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -