我试图在 jstree 中获取所选节点的数据。我可以使用 data.rslt.obj.attr('id') 获取 ID 但是如果我想检索 user101 的电子邮件 ID,如何根据所选节点获取数据值?我试过data.rslt.obj.attr('data'),但无法实现,请指教。
{
"state":"open",
"data":"com",
"attr":{
"id":"test1",
},
"children":[
{
"state":"open",
"attr":{
"id":"testus1",
},
"data":{
"title":"vls",
"emailAddress":"vls@gmail.com"
},
"children":[
{
"state":"closed",
"attr":{
"id":"testus2",
},
"data":{
"title":"vfg"
},
"children":[
null,
{
"state":"closed",
"attr":{
"id":"testus3",
},
"data":{
"title":"user19"
},
"children":[
{
"state":"closed",
"attr":{
"id":"user101",
},
"data":{
"title":"user101",
"emailAddress":"test1@csc.com"
}
},
{
"state":"closed",
"attr":{
"id":"testus11",
},
"data":{
"title":"testuser11",
"emailAddress":"test@csc.com"
},
}
]
}
]
},
null
]
},
null
]
}
Regards,
Prabkar