I'm using the jquery jstree component, but the problem is the inbuilt themes use the same icon for a node with children and a leaf node which isn't ideal.
How would i go about modifying the css to specify a custom icon for leaf nodes only?
Cheers.
You want to have a look at types plugin
The types enables node types - each node can have a type, and you can define
rules on how that type should behave - maximum children count, maximum depth,
valid children types, selectable or not, etc.
I needed the same thing, and after reading the project's bug-tracker, I found this:
https://github.com/vakata/jstree/issues/1125
Add the icons to the data you are passing to jstree (you could use
"icon" : "jstree-file"
for each node you need to have a different icon).
Why this isn't the default, beats me... but, I think this should do what you wanted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With