redefine template css dynamically

Hello ,
I want to redefine a template every seconds , It is ok for text of template but there is a problem with css. When I use “define” function , css is add every seconds but the last css is not removed.

$$(“detailInfo”).define({
template : data.json().detail[0].description,
css : familyCss
});

(With familyCss my variable)

The text isn’t add to the last text but replaced so it’s ok. But it is not the same comportement with css. Is it normal ?

In DOM I have something like that :
div class = “webix_view log_flow_events log_flow_events log_flow_events log_flow_events log_flow_system log_flow_events log_flow_events log_flow_events log_flow_events log_flow_events…”

How it possible to redefine just the correct css every seconds?

Thanks

assume that custom class names start with ‘log_flow_’

function setClass(){
   var $view = $$('template_id').$view;
   var $className = $view.className.split(/\\s+/).map(function(cn){
      return (cn && cn.indexOf('log_flow_')) ? cn : '';
   }).join(' ') + ' ' + familyCss;
   $view.className = $className;
}
setInterval(setClass, 1000);

did not try, but should work

Perfect :wink: thanks