📌  相关文章
📜  kendo treeview 获取选定的节点数据 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:23.903000             🧑  作者: Mango

代码示例1
// First to which ever element you specified your treeview with its datasource
// Create a new variable of it:

var tv = $('.mytree').data('kendoTreeView');

// You can get the node that you select by calling select() on your treeview
var selected = tv.select();

// Then use your selected as a parameter in the dataItem() function.
var item = tv.dataItem(selected);

// Then you can see what kind of data is inside it by e.g.
console.log(item); // and opening the inspector and expanding your item object

// Or
alert(JSON.stringify(item));

// The object you specified in the data source will be shown with other useful variables.

// To see how to use the data source with json check http://jsfiddle.net/NZq4A/2/