c# - Custom Kendo UI Treeview construction -


i want build out hybrid tree shows global view of entire system. system content managmeent system has other functions can managed within "collection of odata contexts" make global api.

so i'm trying figure out how can make heirarchical datasource of sorts work varying url's based on node type , sprinkling of dynamic model metadata.

for example ...

i have api functions in framework allow me ...

my.api.get("context/type", function(odatacollectionresult) {      ... }); 

i know kendo ui supports doign ...

var viewmodel = new kendo.data.hierarchicaldatasource({     type:'odata-v4',    ... });  $("#tree").kendotreeview({ datasource: viewmodel ... }); 

... question ...

how can setup kendo treeview bind custom datasource calls custom expand , collapse functions can make decisions based on more complex things know nodes represent?

i need because depending on node type it's children come different endpoints can't use odata datasource.

i'm trying can't seem work ...

var viewmodel = {      data: [],      expand: function(node) {           var myparams = { endpoint: "context/type", childnodetype: "foo/bar" };           my.api.get(myparams.endpoint, function(data) {               node.data.children = buildnodes(myparams.childnodetype, data);           });      },      collapse: function(node) {          ...      }    } }  $("#mytree").kendotreeview({      datasource: viewmodel,      events: { onexpand: viewmodel.expand, oncollapse: viewmodel.collapse }  }); 

has done or has suggestions on how might working?

ok realise stupidity of question somehow managed not find ...

http://demos.telerik.com/kendo-ui/treeview/events

... think have pieces need this.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -