Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    slider item

    We found some inconsistencies with the documentation for slider item and wanted to get it cleared up.

    In /isomorphic/system/reference/SmartClient_Reference.html#attr..SliderItem.minValue the documentation says that minValue can be initialized and read.

    If you look into isomorphic/system/reference/SmartClient_Reference.html#method..SliderItem.setMinValue

    and hover over "minimum value" where it says "Sets the minimum value of the slider", it says minValue is writeable as well.

    Which is it? Same issue with maxValue. We are assuming it is NOT writeable because when we call setMaxValue, it does not update maxValue.


    Code:
    isc.DynamicForm.create({
        width: 200,ID:"testDyn",
        fields: [
            { name: "rating", title: "Rating", editorType: "slider",
              minValue: 1, maxValue: 5, numValues: 5, width: 200, titleOrientation: "top",ID: "sliderTest"}
        ],
        values: { rating: 4 }
    });
    
    isc.Button.create({top:200,title:"setMax", click: function(){sliderTest.setMaxValue(10);isc.warn(sliderTest.maxValue);}});

    #2
    Thanks for pointing this out. Yes they can be set after init, the documentation has been updated in 3.0 to clarify this.

    Comment


      #3
      Ok. Was the testcase fixed as well? Because with the code I provided maxValue was not updated when calling setMaxValue

      Comment


        #4
        The slider itself is updated. The value sliderTest.maxValue won't reflect the change, but sliderTest.canvas.maxValue will.

        Comment


          #5
          ah ok. thanks.

          Comment


            #6
            We want to dynamically be able to change the minimum/maximum for the slider but for some reason every time we do, the value that we have set for the slider changes. Is this intended behaviour? It does not make sense that the min value would have a full effect on the actual value of the slider. Please clarify. Thanks.


            Code:
            isc.DynamicForm.create({
                width: 200,
                fields: [
                    { name: "rating", title: "Rating", editorType: "slider",
                      minValue: 0, maxValue: 5, numValues: 5, width: 200, titleOrientation: "top", ID: "testSlider"},
                    {title: "Change", type:"ButtonItem",     click: function() {testSlider.setMinValue(0);}}
                ]
            });

            Comment


              #7
              Looks like it's a side-effect of re-creating the scale and ticks. We'll correct it, but the workaround is simple: capture and re-apply the value.

              Comment


                #8
                This has been fixed - it will now only reset the value if it falls outside of the range set by the new min/maxValue and it will be set to the closest of those values.

                Comment

                Working...
                X