Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
4369 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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

Auteur Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
2
mars 23
9996
2
mars 23
2428
0
mars 22
1572
1
mai 21
4318
1
sept. 20
3521