我正在使用数据源显示树视图,但在拖放之后会有更改,我必须得到更改的新数据源。我怎么做?
$.ajax({
type: "POST",
url: "TestMenu.aspx/GetMenuData",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
$("#treeview").kendoTreeView({
dragAndDrop: true,
dataSource: $.parseJSON(data.d)
});
}
});
所以,我终于完成了任务。为那些正在寻找与我相同答案的人发布答案。 将通话更改为:
$.ajax({
type: "POST",
url: "TestMenu.aspx/GetMenuData",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
$("#treeview").kendoTreeView({
dragAndDrop: true,
dataSource: $.parseJSON(data.d)
}).data("kendoTreeView");
}
});
然后获取更新的数据源:
var treeviewDataSource = $("#treeview").data("kendoTreeView").dataSource.view();