Cannot Set Slider Value(s)

5 posts, 0 answers
  1. Tom
    Tom avatar
    11 posts
    Member since:
    Jan 2012

    Posted 14 Aug 2012 Link to this post

    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.
  2. Ifdev02
    Ifdev02 avatar
    68 posts
    Member since:
    Jul 2007

    Posted 07 Oct 2012 Link to this post

    Hi I stuck for hours for same issue. I just cant initialize the first rage.
  3. Kendo UI is VS 2017 Ready
  4. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 08 Oct 2012 Link to this post

    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!
  5. Helga
    Helga avatar
    3 posts
    Member since:
    Jan 2013

    Posted 29 Jul Link to this post

    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?

  6. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 03 Aug Link to this post

    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.
     
Back to Top
Kendo UI is VS 2017 Ready