I'm using the Slider plugin for Yii2 and have set 'id' => 'amount-slider' under Slider widget configuration. I also have some JS on my page and am trying to set the slider value with $('#amount-slider').slider('setValue', temp);. This gives me an error:
Error: cannot call methods on slider prior to initialization; attempted to call method 'setValue'.
So I'm asking how is the widget initialized and how can I access it with JS? I got it working for a moment, but then I lost some of my code and cannot figure it out again.
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/31483189-what-s-the-id-of-the-slider-initialized?utm_campaign=plugin&utm_content=tracker%2F2315488&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2315488&utm_medium=issues&utm_source=github).
Hi
I'm using the Slider plugin for Yii2 and have set
'id' => 'amount-slider'
under Slider widget configuration. I also have some JS on my page and am trying to set the slider value with$('#amount-slider').slider('setValue', temp);
. This gives me an error:Error: cannot call methods on slider prior to initialization; attempted to call method 'setValue'
.So I'm asking how is the widget initialized and how can I access it with JS? I got it working for a moment, but then I lost some of my code and cannot figure it out again.