OdinaSpb / jstree

Automatically exported from code.google.com/p/jstree
0 stars 0 forks source link

Help ! ! jstree checkbox selected initialization #980

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use jstree latest version, I want to initialize jstree checkbox, I want to 
set some nodes selected! To give a demo, or a part of the code Thank you! Mr. 
Song 19665385@qq.com

 $(function () {
    $("#jstree").jstree({
       "core" : {
                "animation" : 100,
                "strings" : {"loading" : "加载中.."," new_node" : "新节点", "errorMessage" : "没有节点数据!"}
                // "initially_open" : ["1"] 
            }, 
        "json_data" : {
            "ajax" : {
                //"url" : "./resource/jstree/_docs/_json_data.json",
                "url" : "./jstree.do",
                "data" : function (n) { 
                    var a=n;
                    return { id : n.attr ? n.attr("id") : 0 }; 
                }
            }
        },
        checkbox : {
                state_type :"three-state"
            },
         plugins : ["themes", "json_data","checkbox", "types", "ui", "hotkeys"],
         //那个被选中的,会触发选中事件
          "ui":{
            initially_select:['1']
           }

    }).bind("loaded.jstree", function (even,data) { 

           });

Original issue reported on code.google.com by hacker...@126.com on 13 Jul 2011 at 2:43