0

在引导树视图组件中,我试图获取特定的节点值但无法正确遍历。任何帮助深表感谢。这是我的 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 )           
}
4

1 回答 1

0

啊! 喝杯咖啡后发现它:)

node['nodes'][0].risk; 
于 2016-04-07T17:14:26.190 回答