Link Many Objects in Javascript
This guide addresses how to write arbitrary JS callbacks linking one or more components.
Sometimes defining a simple link between two objects is not sufficient, e.g. when there are a number of objects involved. In these cases it is helpful to be able to define arbitrary Javascript callbacks. A very simple example is a very basic calculator which allows multiplying or adding two values, in this case we have two widgets to input numbers, a selector to pick the operation, a display for the result and a button.
To implement this we define a jscallback
, which is triggered when the Button.clicks
property changes and provide a number of args
allowing us to access the values of the various widgets:
Related Resources
See the Explanation > APIs for context on this and other Panel APIs