Changing slider widgets value in callback function

Hey,

I’m trying to update a slider widget’s value attribute in a callback function by a TextInput widget. I pass the slider widget object into the CustomJS function with the CustomJS function looking like this:

TextInput(title=“Enter UTC Time”, callback=CustomJS(args=dict( slider=slider), code=code))

The statement I’ve been using to try to change the slider is:

slider.get(‘value’) = 10;

slider.trigger(‘change’);

This is not working though.

Thanks for the help,

Kyle

Hi Kyle,

The "slider.get" is a method to get the value, to set it you'll want "slider.set("value, 10)"

Note that in an upcoming release you'll just be able to do "slider.value" and "slider.value = 10"

Byran

···

On Jun 16, 2016, at 3:15 PM, [email protected] wrote:

Hey,

I'm trying to update a slider widget's value attribute in a callback function by a TextInput widget. I pass the slider widget object into the CustomJS function with the CustomJS function looking like this:

TextInput(title="Enter UTC Time", callback=CustomJS(args=dict( slider=slider), code=code))

The statement I've been using to try to change the slider is:

        slider.get('value') = 10;
        slider.trigger('change');

This is not working though.

Thanks for the help,

Kyle

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/02e32328-95f3-4662-bb11-65f9e5d6a8e0%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Much obliged. You’re the man!

···