Custom icons for jsTree nodes


/ Published in: JavaScript
Save to your folder(s)

Where nodes have rel attribute, in this case custom icon is for rel="file".


Copy this code and paste it in your HTML
  1. $("#treeViewContainer")
  2. .jstree({
  3. "core": {
  4. "animation": true,
  5. "initially_open": initiallyOpen
  6. },
  7. "html_data": {
  8. ...
  9. },
  10. "plugins": ["themes", "html_data", "ui", "types"],
  11. "ui": {
  12. "select_limit": 1
  13. },
  14. "types": {
  15. "types": {
  16. "file": {
  17. "icon": {
  18. "image": "../images/file.png"
  19. }
  20. }
  21. }
  22. }
  23. })
  24. .bind("select_node.jstree", function (event, data) {
  25.  
  26. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.