jQuery UI Widgets Forums Editors ScrollBar, Slider, BulletChart, RangeSelector Problem to set the minimum value after slider widget is initialized

This topic contains 6 replies, has 3 voices, and was last updated by  Dimitar 8 years ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author

  • mger
    Participant

    Hi,

    I have a problem to set the minimum value for a slider after it is initialized. I can set the min-value, but the method ‘setValue’ is ignored. To set the maximum value works fine.

    e.g

    $(“#slider”).jqxSlider(
    {theme: theme
    , width: 370
    , value: 2
    , max: 35
    , min: 10
    , mode: ‘fixed’
    , step: 0.01
    , tooltip: false

    });

    $(“#slider”).jqxSlider({min: 10, max: 20});

    $(“#slider”).jqxSlider(‘setValue’, 15);

    The slider will show the value 10 and not 15.

    Is this a little bug or am I barking up the wrong tree.

    Thanks for your help!

    Best regards,

    Mark


    Dimitar
    Participant

    Hi Mark,

    Here is an example based on yours. A button changes the min and max and also sets the value. We have not encountered any issues in it. It works without the button, too.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>jQuery Slider Sample</title>
    <link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css"/>
    <link rel="stylesheet" href="jqwidgets/styles/jqx.summer.css" type="text/css"/>
    <script type="text/javascript" src="jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="jqwidgets/jqxslider.js"></script>
    </head>
    <body>
    <div id='content'>
    <script type="text/javascript">
    $(document).ready(function () {
    $("#jqxslider").jqxSlider({ theme: 'summer', width: 370, value: 2, max: 35, min: 10, mode: 'fixed', step: 0.01, tooltip: false});
    $('#jqxslider').bind('change', function (event) {
    $('#jqxsliderValue').html('Value: ' + event.args.value);
    });
    $("#btn").click(function(){
    $("#jqxslider").jqxSlider({min: 10, max: 20});
    $("#jqxslider").jqxSlider('setValue', 15);
    });
    });
    </script>
    <div id="jqxsliderValue">Value:</div>
    <div id='jqxslider'></div>
    <button id="btn">Set min, max and value</button>
    </div>
    </body>
    </html>

    Best Regards,
    Dimitar,

    jQWidgets team,
    http://www.jqwidgets.com/


    mger
    Participant

    Ups, found my mistake. Sorry…


    gaurav30hkr
    Participant

    Hi
    I am using jqxslider.
    $(‘#jqxSlider’).jqxSlider({
    theme: ‘success’,
    width: 220,
    height: 60,
    value: 30,
    max: 100,
    min: 0,
    mode: ‘fixed’,
    step: 1,
    showTickLabels: true,
    ticksFrequency: 40,
    tooltip: true,
    tickSize: 5,
    tooltipPosition: “far”,
    });

    with angularjs .

    In my scenario there are 3 html pages and 2 controllers , On fisrt page slider is defined.
    When user is moving from first page to second and then to third everything is fine ,
    when user again moves back to first page it gets disappeared.
    When I checked in through inspection , found that its aria-disabled property is setting to false.
    I tried to set its css through script but got failed.


    Dimitar
    Participant

    Hi gaurav30hkr,

    Is there any other JavaScript code that manipulates this slider? If so, could you, please, share it, too? Please also refer to our AngularJS jqxSlider example: http://www.jqwidgets.com/jquery-widgets-demo/demos/angularjs-demos/slider.htm?light.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    gaurav30hkr
    Participant

    Thanks for quick reply. 🙂

    only this for setting value
    $(‘#jqxSlider’).on(‘change’, function (event) {
    $rootScope.ConfidenceThreshold = new Number(event.args.value);
    });

    no such manipulation on the slider is being performed.
    Let me check with AngularJS jqxSlider.


    Dimitar
    Participant

    Hi gaurav30hkr,

    We are looking forward to your feedback. Please also share if there are any errors thrown in your browser’s console when the slider disappears.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.