vakata / jstree

jquery tree plugin
http://jstree.com
MIT License
5.13k stars 1.39k forks source link

Wrap text of <a> (jstree-anchor) into <span> #1930 #2741

Closed rajnikantdas84 closed 1 year ago

rajnikantdas84 commented 1 year ago

Hi @vakata and team,

I know this is an old and closed issue, but I am not able to get the solution for this. So looking for the help.

Another node

It would be helpful im many ways (styling, text truncation with ellipsis etc.) to place this text inside a span/i/whatever. For example adding a span with the class jstree-label around "Another node":

Another node

old issue ref: https://github.com/vakata/jstree/issues/1930

vakata commented 1 year ago

The anchor has a specific semantic meaning. Still - all of jstree's internal operations DO NOT rely on the anchor tag, so you could theoretically swap it for a SPAN. You can achieve that by overriding _create_prototype_node in a plugin - copy and paste the function in a plugin and load that plugin (there are plenty of examples in src/misc.js).