Change Css dynamically between two treetables

Hello,

I have a view with two treetables and a css defined with color for row selected.
I want when I click in a treetable redefine the color of row selected and change at the same time the color of the row selected of the other treetable.

I can redefine css on event click in one treetable with “$$(“treetable1”).define(“css”,“row_selected_blue”)” an event “onAfterSelect” but I can’t redefine the color dynamically of the second treetable at the same time ("$$(“treetable2”).define(“css”,“row_selected_red”)")

Any ideas ?

I have seen that it’s work just the first time. we cant’ use redefine an element that have been already defined

to get the result you should call refresh() after define()

Already try , it doesn’ t work :wink:

here an example with a datatable :

http://webix.com/snippet/92e9a63f

I want the last row clicked be red and the row in other datatable became blue.

try to combine addCss and removeCss commands
http://docs.webix.com/api__link__ui.datatable_addcss.html
http://docs.webix.com/api__link__ui.datatable_removecss.html

Applying/removing the CSS will not work through the define, as it won’t remove existing class from the DOM. Please use add/removeCss() methods instead:

http://webix.com/snippet/8af1844b

Thanks :wink: