Search code examples
jstree

Underline node text in jstree


I want to underline the node text in jstree. Is there an API available to do so? Can there be a class attached to the node that does so? The underline should not go even if the node gets renamed.


Solution

  • I got it done through the "a_attr" attribute in the type configuration of the tree. Whatever, you specify in here gets applied to the text

    "nodeType": {
                    "icon": "folder-icon.png",
                    "valid_children": [],
                    "a_attr": { "style": "text-decoration: underline" }
                },