Node icon in a jsTree tree with font-awesome

Viewed 13011

I have a tree structure using jsTree, like this:

<div id="jstree">
        <ul>
           <li>Root 1
             <li> Child 1</li>  
           </li>   
        </ul>
</div>

I would like to put icons of font-awesome for the roots and children. Here is explained how to do it with bootstrap, below and example:

 <li data-jstree='{"icon":"glyphicon glyphicon-leaf"}'>Child</li>

I tried by doing this:

<li data-jstree='{"icon":"fa fa-user fa-2x"}'>

and this is the error that the browser tells me:

Invalid character (:) in expression "icon":"fa fa-user fa-2x"

I should also mention that I am using XML and XSL.

Does anyone have an idea about this issue?

3 Answers
Related