Define CSS not working properly

Hi. I am using css styles to update the color of accordionitems. Counter starts at 0 with the background being gray. If counter > 0 than the background turn green. When the counter goes back to zero, background back to gray. Up to this poing it works properly. But if counter goes up again it wont turn green anymore.

.non_empty .webix_accordionitem_header.collapsed{
background:#077f07;
}

.my_empty .webix_accordionitem_header.collapsed{
background:#a3b4be;
}

function refreshTitle(elem){
if(orderList[elem] > 0)
$$('acc' + elem.toString()).define("css", "non_empty");
else
$$('acc' + elem.toString()).define("css", "my_empty");

$$('acc' + elem.toString()).refresh();
}

Could you please tell me where it might get stuck. Thank you

Comments

  • i have found the answer here:
    https://forum.webix.com/discussion/6927/define-css-my-css

    changes code to:

    if(orderList[elem] > 0){
    webix.html.removeCss( $$('acc' + elem.toString()).getNode(), "my_empty");
    $$('acc' + elem.toString()).define("css", "non_empty");
    }else{
    webix.html.removeCss( $$('acc' + elem.toString()).getNode(), "non_empty");
    $$('acc' + elem.toString()).define("css", "my_empty");
    }

    Thank you :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion