disable button

I have a button object like this

                {
                    view: 'button',
                    type: 'icon',
                    paddingY: 8,
                    icon: 'fas fa-plus',
                    label: _labels.add,
                    id: 'add-button',
                    autowidth: true,
                    disabled: true,
                    click: function () {
                        //some code
                    }
                },

This button is disabled. Later then I enable this button with:

$$(‘add-button’).config.disabled = false;
$$(‘add-button’).refresh();

But the icon get the color #aaaaaa because of this:

.webix_disabled_view.webix_control .webix_icon_btn, .webix_disabled_view.webix_control .webix_icon {
color: #aaaaaa;
}

This button still have the webix_disabled_view! :-/

What is the best way to get rid of this?

Thank you and

Have a wonderful christmas time

Michael

Workaround is:
$(‘div[view_id=add-button]’).removeClass(‘webix_disabled_view’);

try this

$$("button").disable();
$$("button").enable();
or
$$("button").define("disabled", true / false);

https://snippet.webix.com/wkwik3y6

Thanks a lot integral.

That’s what I did! But I’m talking about icon buttons. And I think it could be my fault…

Michael

@Michael
are you sure?
in this and above snippets everything works as expected.
you are using $$('add-button').config.disabled = false;
but proper way is define

$$('add-button').define("disabled", true or false);

Thank you, intregal.

As I told you I will check it out.

Michael