How to associate a data to a node in jstree?

后端 未结 7 1810
温柔的废话
温柔的废话 2020-12-29 07:12
$(\"#ifTree\").jstree({
            \"plugins\" : [\"themes\",\"html_data\",\"ui\",\"crrm\"], 
            \"themes\" : {
                    \"theme\" : \"apple\",
         


        
相关标签:
7条回答
  • 2020-12-29 08:13
    div id="tree_1" class="tree-demo">
        <ul>
            <li data-jstree='{ "opened" : false }' id="c67"> Sıcak İçecekler
                <ul>
                    <li data-jstree='{ "type" : "file", "selected" : false }' id="500">Çay</li>
                    <li data-jstree='{ "type" : "file", "selected" : false }' id="501">Fincan Çay</li>
    
                </ul>
            </li>
            <li data-jstree='{ "opened" : true }' id="c68"> Soğuk İçecekler
                <ul>
                    <li data-jstree='{ "type" : "file", "selected" : true }' id="514">Ayran</li>
                    <li data-jstree='{ "type" : "file", "selected" : true }' id="515">Kola</li>
                    <li data-jstree='{ "type" : "file", "selected" : true }' id="516">Meyveli Gazoz</li>                    
                </ul>
            </li>
        </ul>
    </div>
    

    this html is very suitable for custom ids if you want to solve it by <ul> and <li> elements.

    0 讨论(0)
提交回复
热议问题