Basically, I have jsTree, and I need to format its li and a DOM elements, adding a custom class to each type. The documentation is not clear how to do this, and as far as I can tell, there is no way to add a custom class, any formatting should be related to overriding the jquery theme or by editing the jsTree source code. I'm fine, either doing this in JSON data, or more efficiently when I declare "types", as shown in the example here:
$("#container").jstree({ "plugins" : ["themes", "json_data", "ui", "themeroller", "types"], "json_data" : {"data": my_json_data}, "core" : { "initially_select" : [ init_id] }, "types" : { "valid_children" : [ "test_type" ], "types" : { "test_type" : { "valid_children" : [ "default", "test_type" ], "icon" : { "image" : "/includes/icon.gif"} } } }, "themes" : { "dots" : true, "icons" : true } });
source share