在引导树视图组件中,我试图获取特定的节点值但无法正确遍历。任何帮助深表感谢。这是我的 JSON,
[{
"text": "100 - Environment",
"selectable": false,
"nodes": [{
"text": "100.00.10 Arachnids / Scorpion",
"hid": "M-AMA-HID-1301-009R",
"showIcon": false,
"id": "1",
"nodes": [{
"text": "In general, scorpions are not aggressive.",
"hidden": true,
"risk": "Moderate-High"
}]
}
]
我正在尝试从子节点获取“中高”值。
onNodeChecked: function(event, node) {
var children = node['nodes'];
//displays In general, scorpions are not aggressive."
alert( children[0].text )
}