Skip to Content
Menú
This question has been flagged
2 Respostes
4178 Vistes

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?

Avatar
Descartar
Best Answer

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');


Avatar
Descartar
Autor

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

Autor Best Answer

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)]}

Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de març 23
9756
2
de març 23
2220
0
de març 22
1475
1
de maig 21
4186
1
de set. 20
3426