We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In [3]: param.__version__ Out[3]: '1.10.0a2' In [4]: pn.__version__ Out[4]: '0.10.0a2'
Adding JavaScript code to a Button widget created from a param.Action through js_on_click doesn't have any effect.
param.Action
js_on_click
class JsButton(param.Parameterized): param_btn = param.Action(lambda self: print('Action Python Response'), label='Action') def panel(self): button_wg = pn.widgets.Button(name='Widget') button_wg.on_click(lambda e: print('Widget Python Response')) button_wg.js_on_click(code='console.log("Widget JS Response")') param_btn = pn.Param(self.param.param_btn) param_btn[0].js_on_click(code='console.log("Action JS Response")') return pn.Column( param_btn, button_wg, ) test = JsButton() test.panel()
Python callback returned following output: Action Python Response Widget JS Response Python callback returned following output: Widget Python Response
The text was updated successfully, but these errors were encountered:
As a work around you can do this
class JsButton(param.Parameterized): param_btn = param.Action(lambda self: print('Action Python Response'), label='Action') def panel(self): button_wg = pn.widgets.Button(name='Widget') button_wg.on_click(lambda e: print('Widget Python Response')) button_wg.js_on_click(code='console.log("Widget JS Response")') param_btn = pn.Param(self.param.param_btn)[0] param_btn.js_on_click(code='console.log("Action JS Response")') return pn.Column( param_btn, button_wg, ) test = JsButton() test.panel()
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
ALL software version info
Description of expected behavior and the observed behavior
Adding JavaScript code to a Button widget created from a
param.Action
throughjs_on_click
doesn't have any effect.Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
The text was updated successfully, but these errors were encountered: