Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing color of selected node in jstree

I want to change the background color of my selected node in jstree.

$('#syncrep').jstree({
                                        'core' : {
                                            'data' : repository
                                        }
                                    }).bind("loaded.jstree",
                                    function(event, data) {
                                        $(this).jstree("open_all");
                                    }).on("select_node.jstree",
                                    function(e, data) {

                                        Repository_SelectedNode = $('#syncrep')
                                                .jstree('get_node', data.node);

                                        Repository_SelectedNode_Copy = angular
                                                .copy(Repository_SelectedNode);
                                                });

I tried using an inbuilt API of jstree 'redraw' but it is not serving my purpose.

like image 240
Siddharth Avatar asked Dec 15 '25 04:12

Siddharth


1 Answers

Can you change style for the .jstree-default .jstree-clicked class?

See below, also check demo - Fiddle Demo.

.jstree-default .jstree-clicked {
  background: green;
}
like image 125
Nikolay Ermakov Avatar answered Dec 16 '25 22:12

Nikolay Ermakov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!