Radek
Radek

Reputation: 11121

different color for different levels of rows in jsTree

how can get different row color for different 'level' of rows in jsTree

let's say that in my sample http://jsfiddle.net/radek/sTmrv/2/

Upvotes: 1

Views: 3996

Answers (2)

g_thom
g_thom

Reputation: 2810

Would this work for you? See http://jsfiddle.net/sTmrv/4/

You may have to play with it a bit (untested in IE).

li.jstree-open > ul {
    background: red;
    display: block;
}
li.jstree-open > ul li.jstree-open > ul {
    background: #CCC;
    position: relative;
    left: -18px;
    padding-left: 18px;
    width: 100%;
 }

Upvotes: 3

Daedalus
Daedalus

Reputation: 7722

You could do a loop with a generated row id, and base the colors on the multiple of the row Id.. let me try typing up something quickly.

Upvotes: 1

Related Questions