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{

.my_empty .webix_accordionitem_header.collapsed{

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

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

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


  • i have found the answer here:

    changes code to:

    if(orderList[elem] > 0){
    webix.html.removeCss( $$('acc' + elem.toString()).getNode(), "my_empty");
    $$('acc' + elem.toString()).define("css", "non_empty");
    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