Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
4026 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

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

Autor Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
bře 23
9601
2
bře 23
2029
0
bře 22
1349
1
kvě 21
4007
1
zář 20
3315