☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How to know that all js from bokeh is executed

Community Supportcustomjs
GSasha
GSasha

Hi I have a function in js that grabs the selected value from a dropdown widget (created with bokeh) on start. But the problem is sometimes the widget is not ready on the inital load so my

$("#widget").val(); 

is not defined yet. What I did is a bit of a hack for now: I call the init function with a timeout

setTimeout(init, 50);

which is weird and probably not robust.

Maybe there is an event that could be used to attach a jscallback to the widget?

⌁   Link to post
Bryan
Bryan

If this is a Bokeh server app, then version 2.2 added a DocumentReady event that can trigger a Python callback:

curdoc().on_event(DocumentReady, ...)

If this is not a Bokeh server app (i.e., if this is just static HTML output), then there is not yet any built in option. it is still an open issue to expose DocumentReady for JS callbacks.

⌁   Link to post

End of archived discussion · Replies are disabled