close

.on('ready.jstree', function (e, data) {

    data.instance.open_node(["id1","id2","id3"]);   // 帶入node的id
    data.instance.select_node(["id1","id2","id3"]);  // 帶入node的id
})

--

 

vakata commented on 11 Feb 2014

Set this in your data - take a look at the docs - if using HTML set a data-jstree='{"opened":true,"selected":true}' on the LI node, if using HTML set state : {"opened":true,"selected":true}

You can always do this in the ready.jstree event too:

.on('ready.jstree', function (e, data) {
  data.instance.open_node(["id1","id2","id3"]);
  data.instance.select_node(["id1","id2","id3"]);
})

Best regards,
Ivan

 

 

--

轉自 https://stackoverflow.com/questions/8466370/how-to-select-a-specific-node-programmatically/23641202

 

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 dizzy03 的頭像
    dizzy03

    碎碎念

    dizzy03 發表在 痞客邦 留言(0) 人氣()