2016-08-10 76 views
0

我有以下用於aciTree插件的JSON源,並且想要檢索節點"tree-data"的值。我沒有在文檔中看到任何特定的功能。有什麼想法嗎 ?在AciTree插件中獲取特定的節點數據

[{ 
    "id": "-", 
    "label": "100 - Environment", 
    "inode": true, 
    "open": false, 
    "checkbox": false, 
    "branch": [{ 
     "id": "M-CSP-HID-1301-01W8", 
     "label": "100.10.10 Dangerous Fauna", 
     "inode": true, 
     "open": false, 
     "checkbox": true, 
     "tree-data": "M-CSP-HID-1301-01W8#^Dangerous Fauna#^Low", 
     "branch": [{ 
      "id": "-", 
      "label": "Coming into contact (ingestion, bites, stings, injection) with potentially dangerous animals that include - Invertebrate - Protozoa (one celled organisms - amoeba), Arachnids (Spiders, scorpions), Insects (mosquitoes, fire ants, bees), Crustaceans (Crabs), Annelids (Leeches), Echinoderms (Sea Urchin), Scyphozoa (Jelly Fish): Vertebrate - Fish (Shark, piranha, stingray), Amphibians (dart frogs), Mammals (Cows, Moose, Whales, etc.), Rodents (Rats, mice, etc.), Primates (Apes) , Reptiles (snakes, alligator, etc.), Birds (Raptors)", 
      "checkbox": false 
     }] 
    } 
    ] 

回答

1

很簡單,

var itemData = api.itemData(item); 
tnode=itemData._nodedata; 

「樹數據」 被重命名爲_nodedata。