コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4351 ビュー

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
9981
2
3月 23
2414
0
3月 22
1567
1
5月 21
4308
1
9月 20
3520