jqTree icon indicating copy to clipboard operation
jqTree copied to clipboard

Can I set image icon to Root & Child node ?

Open ChetanChaudhari03 opened this issue 12 years ago • 5 comments

Hi, Right now in current JQTree we can specified only openIcon & closedIcon but we cann't set child icon so can you please tell me how can i set Icon/Image to child node?

I change your code that function name is "ElementsRenderer.prototype.createNodeLi" so can you please change that as per of the code "ElementsRenderer.prototype.createFolderLi" and set new option for "childIcon". so we can set new childIcon.

Is am I right or wrong please tel me? if right then please change your code respective what i say.

Thanks, Chetan

ChetanChaudhari03 avatar Apr 29 '14 08:04 ChetanChaudhari03

Hello Chetan,

What exactly do you want to do? Do you want to display an icon in child nodes?

This examples adds an icon to child nodes. Note that it uses fontawesome:

$('#tree1').tree({
    onCreateLi: function(node, $li) {
        if (! node.hasChildren()) {
            $li.find('.jqtree-element').prepend('<i class="fa fa-dot-circle-o"></i>');
        }
    }
});

I tested this in the dev branch. It probably needs some css adjustment.

Greetings, Marco

mbraak avatar Apr 29 '14 09:04 mbraak

Yes I want same, But I want any option variable so I can set one time value to this variable i don't want to code. Sorry but I'm poor in jquery coding. :) Thanks, Chetan

ChetanChaudhari03 avatar Apr 29 '14 09:04 ChetanChaudhari03

Thank you @mbraak, that helped me a lot

javierRomano avatar Apr 17 '15 16:04 javierRomano

@javierRomano that's y this portal is there...

Ur always welcome here & questions. :)

ChetanChaudhari03 avatar Apr 17 '15 16:04 ChetanChaudhari03

@javierRomano that's y this portal is there...

Ur always welcome here & questions. :)

ChetanChaudhari03 avatar Apr 17 '15 16:04 ChetanChaudhari03