This is a migrated thread and some comments may be shown as answers.

Cannot Set Slider Value(s)

4 Answers 321 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 14 Aug 2012, 02:48 PM
I am currently unable to set the values of a slider and rangeslider on a page.  There are no Javascript errors, it appears the sliders are just not redrawing with the new values.  Sliders:

<div>
@{
Html.Kendo().RangeSlider<double>()
      .Name("theRangeSlider")
      .Min(0).Max(100)
      .SmallStep(1)
      .LargeStep(10)
      .Values(new double[] { Model.LowLimit, Model.HighLimit })
      .Events(e => e.Slide("onRangeSliderChanged"))
      .HtmlAttributes(new { style = "width: 425px;" })
      .Render();
}
</div>
<div>
@{
Html.Kendo().Slider<double>()
      .Name("theSlider")
      .Min(0).Max(1)
      .SmallStep(.01)
      .LargeStep(0.1)
      .Tooltip(t => t.Format("{0:P0}"))
      .Value(Model.SliderValue)
      .ShowButtons(false)
      .Events(e => e.Slide("onSliderChanged"))
      .HtmlAttributes(new { style = "width: 425px;" })
      .Render();
}
</div>

How I am setting the values:
$("#theSlider").data("kendoSlider").value(sliderValue);
$("#theRangeSlider").data("kendoRangeSlider").value([lowerValue, higherValue]);
//Have also tried:
$("#theRangeSlider").data("kendoRangeSlider").values([lowerValue, higherValue]);
$("#theRangeSlider").data("kendoRangeSlider").value(lowerValue, higherValue);
$("#theRangeSlider").data("kendoRangeSlider").values(lowerValue, higherValue);

The strange thing is the values appear to be "sticking" for the sliders, as in if you reference $("#theRangeSlider").data("kendoRangeSlider").values() the values are exactly as I set them.  The slider just does not change.

4 Answers, 1 is accepted

Sort by
0
Ifdev02
Top achievements
Rank 1
answered on 07 Oct 2012, 09:53 AM
Hi I stuck for hours for same issue. I just cant initialize the first rage.
0
Hristo Germanov
Telerik team
answered on 08 Oct 2012, 06:34 AM
Hello,

Unfortunately I am not able to reproduce this issue locally. Could you please send us a simple test project which reproduces the depicted issue? Thus I will be able to observe the problem and advice you further.

Greetings,
Hristo Germanov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Helga
Top achievements
Rank 1
answered on 29 Jul 2016, 02:44 PM

Hi,

i'm having the same problem with a double type slider. The values just stay at the defined min max values, while sliding.

Version : Kendo.Mvc 2014.3.1316.440

What was the problem here?

0
Danail Vasilev
Telerik team
answered on 03 Aug 2016, 11:10 AM
Hello Helga,

Does upgrading to the latest Kendo UI version - 2016.2.714 help? If not, it would be better to send us a runnable sample where we can replicate the issue and investigate it further.

Regards,
Danail Vasilev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Slider
Asked by
Tom
Top achievements
Rank 1
Answers by
Ifdev02
Top achievements
Rank 1
Hristo Germanov
Telerik team
Helga
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or