我与“虚拟树枝演示”一起, 似乎无法找到办法,
tree.getSelection().addListener("change", function(e){
var selection = tree.getSelection();
console.log(selection.getItem(0).getName()); // works just fine to get the name
}
我想到JSON商店的"祖父母"和"父母"的地产
{
"name": "root",
"children": [
{
"name": "Grandparent",
"children": [
{
"name": "Parent",
"children": [
{
"name": "Name of my Selected Item",
我试过了
tree.getModel().getChildren().getItem(0)
但获取 X 值以获得项目(X) 也不是直截了当的。
我很感激你能帮上忙 谢谢!