跳至内容
菜单
此问题已终结
2 回复
4379 查看

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

形象
丢弃
相关帖文 回复 查看 活动
2
3月 23
10010
2
3月 23
2433
0
3月 22
1576
1
5月 21
4323
1
9月 20
3524