Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

[ipywidgets] how to trigger a widget data update from javascript #148

Open
akhmerov opened this issue Mar 17, 2017 · 3 comments
Open

[ipywidgets] how to trigger a widget data update from javascript #148

akhmerov opened this issue Mar 17, 2017 · 3 comments

Comments

@akhmerov
Copy link
Member

Hi! I'm using ipywidgets (v5.2.2 due to jupyter/dashboards_server#317). I also attached autocomplete from jqueryui to a Text. However I see that triggering the autocompletion doesn't sync the data with the python side and requires an extra keypress in the widget.

Is there a way to trigger the synchronization of the widget state manually from javascript?

@jasongrout
Copy link
Member

Are you wanting to send state from the frontend to the backend, or request state from the backend?

@jasongrout
Copy link
Member

To send current state changes from a widget view to the kernel, use the view.touch() method, like in https://github.com/ipython/ipywidgets/blob/master/jupyter-js-widgets/src/widget_string.ts#L359.

@akhmerov
Copy link
Member Author

Are you wanting to send state from the frontend to the backend, or request state from the backend?

Yes, that's my goal.

Thanks for the pointer. Can you please also tell if it possible to reach the view object though DOM?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants