closing a put_collapse with a function #139
Answered
by
wang0618
Shahin-rmz
asked this question in
Q&A
-
suppose I have following code: put_collapse('Product Cost', [put_row([
put_input('count',type = 'number',placeholder = 'Example: 1000',
label='Please insert the count of your product'),
None,
put_input('price',type = 'float',placeholder = 'Example: 50$',
help_text = 'All prices in USD',label='please insert the price of your product')])
,put_buttons(['func'],onclick = ????)]) When clicking the button, I want to do some calculations and close the collapse. |
Beta Was this translation helpful? Give feedback.
Answered by
wang0618
Jul 12, 2021
Replies: 2 comments 5 replies
-
You can close/open the collapse by using js: |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
Shahin-rmz
-
with use_scope('s1'):
put_collapse('title', 'content')
run_js("$('#pywebio-scope-s1 details').prop('open', open)", open=False) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can close/open the collapse by using js:
run_js("$('details').prop('open', open)", open=False)
orrun_js("$('details').prop('open', open)", open=True)