Kendo UI reload treeview -
i load complex treeview kendo ui via ajax because need load tree 1 request (works fine):
$(document).ready(function() { buildtree(); }); function buildtree(){ $.getjson("admin_get_treedata.php", function (data) { $("#treeview").kendotreeview({ select: function(item) { edittreeelement(item,'tree'); }, datasource: data }); }) }
if try reload complete tree after changing data via ajax new build tree not work correct , not update text.
$.ajax({ type: 'post', url: 'ajax/ajax_update_layer.php', data: { layerid:id, ... }, success: function(data){ buildtree(); } });
what can ido? sven
try on ajax success callback
var data = $("#treeview").data('kendotreeview'); data.datasource.read();
Comments
Post a Comment