0

I have created the HorizontalRangeSlider like this,

    this.horizontalSlider = new HorizontalRangeSlider({
            name : "slider",
            //To place the slider handles at min max.
            value : [10,100],
            minimum : 10,
            maximum : 100,
            intermediateChanges : false,
            showButtons : false,
            onChange : //onChange call method.
        }, this.slider);
        this.horizontalSlider.startup();

        this.horizontalSliderRule = new HorizontalRule({
            container : "topDecoration",
            style:"height:5px",
            count : 2,              
            numericMargin: 1
        }, this.sliderRule);
        this.horizontalSliderRule.startup();

Then after changing the position of the slider handles now i want to reset the position of the slider handles programmatically, for this i am doing like this

this.horizontalSlider.value=[10,100];

But this is not affecting anything in the slider.How to reset the position of the slider?

Manjunath M
  • 588
  • 1
  • 6
  • 30

1 Answers1

0

Simply setting the values by way of using "=" of the RangeSlider won't trigger the code in the slider to update. For most dojo elements, I'd recommend using the below method:

this.horizontalSlider.set("value",[10,100]);

Here's a fiddle with it working: http://jsfiddle.net/g4s05og0/

Richard
  • 1,138
  • 1
  • 6
  • 11
  • @ Richard It's not refreshing the handles position – Manjunath M Oct 29 '15 at 05:53
  • @ManjunathM I'm not sure why your code isn't working. I've edited my answer to include an example of it working. Can you include maybe a fiddle of your code not working? – Richard Oct 29 '15 at 08:02