Modify Get Request of a Kendo UI treeview -
i'm having trouble kendo ui treeview, displays same node each time click go deeper tree.
my problem regular request looks this:
something/getchildren/3432fdsf8989/apr222014083453am
when click next node request looks this:
something/getchildren/3432fdsf8989/apr222014083453am?identifier=2323eded7664
and want have this:
something/getchildren/2323eded7664/apr222014083453am
is possible change url kendo ui hierarchicaldatasource? web service ignoring identifier , still using initial id.
function inittreeview(date, targetid) { var requesturl = "something/getchildren/"+ targetid + "/" + date; var datasource = new kendo.data.hierarchicaldatasource({ transport: { read: { url : requesturl, datatype : "json" } }, schema: { model: { id: "identifier", haschildren: true, //all items may have children } } }); $("#treeview").kendotreeview({ datasource: datasource, datatextfield: "message" }); }
the url
in transport
definition can function. define function generates in proper / desired format.
transport: { read: { url: function(options) { return something/getchildren/"+ targetid + "/" + date; } } }
Comments
Post a Comment