Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
4430 Переглядів

Hi,

I have button, and I want to make it disabled after code execution:

="object"  class="btn-primary"

Is it possible to change class and append `disabled` after clicking button in call_function?

Аватар
Відмінити
Найкраща відповідь

adding class through js, write an onclick function for that particular button and write similar code inside it

var element = document. getElementById('#button_id');

element. classList. add('disabled');


Аватар
Відмінити
Автор

is it possible to change class, from python code? in method `call_function` itself, after button is pressed?

Автор Найкраща відповідь

One way to do this is:

Have a Binary field: is_button_enabled

Have 2 identical buttons is view display, like:


with atrs: invisible and check is_button_enabled field for button1 and button2

attrs="{'invisible': [('is_button_enabled', '=', False)]}

and

attrs="{'invisible': [('is_button_enabled', '=', True)]}

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
бер. 23
10049
2
бер. 23
2455
0
бер. 22
1601
1
трав. 21
4388
1
вер. 20
3565