I need to change the icons of tree images and enable / disable checkboxes, please see the code below:
function LoadJSTree() { $.noConflict(); $(function () { $('#demoTree').jstree({ 'checkbox': { 'keep_selected_style': false, 'two_state': true }, "types": { "#": { "max_children": 1, "max_depth": 4, "valid_children": ["root"] }, "root": { "icon": "/static/3.1.1/assets/images/tree_icon.png", "valid_children": ["default"], "check_node": false, }, "default": { "valid_children": ["default", "file"], "check_node": true, "uncheck_node": true }, "disabled":{ "check_node": false, "uncheck_node": false }, "file": { "icon": "glyphicon glyphicon-file", "valid_children": [], "check_node": true, "uncheck_node": true } }, "plugins": ["types"], 'core': { 'data': [ { "text": "Root node", "type": "root", "parent":"#", "children": [ { "text": "Child node 1", "type": "default" }, { "text": "Child node 2", "type": "default" }, { "text": "Child node 3", "type": "default" }, { "text": "Child node 4", "type": "default" }, { "text": "Child node 5", "type": "default" }, { "text": "Child node 6", "type": "default" }, { "text": "Child node 7", "type": "default" }, { "text": "Child node 8", "type": "default" } ] } ], }, 'plugins': ["checkbox"] });
This does not seem to work.
The tree is displayed using the same folder icons for each node and the checkbox always present for each node, should it not be disabled for the "root" node? Could you tell me what happened?