Announcement

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

    Using customized captions on SliderItem

    Hello experts,

    I'm trying to create a SliderItem with customized captions for the range that the Slider is working with. For example, I want to create a slider with a numeric range 1 until 5, but instead of the numerical boundaries "1" and "5" being displayed just below the slider, I want to display "Low" and "High" instead.

    An alternative to this scenario is a SliderItem that displays all step values, and not only the minimum and maximum boundaries. A real-life example could be "Very Low" / "Low" / "Neutral" / "High" / "Very High".

    So far, I've been experimenting with the SliderItem valueMap property which looks promising. But unfortunately to no good result yet:

    Code:
    isc.Slider.create({
        ID: "%itemName%",
        vertical: false,
        type: "send",
        align: "center",
        minValue: 1,
        maxValue: 5,
        numValues: 5,
        valueMap: { 1: "Very Low", 2: "Low", 3: "Neutral", 4: "High", 5: "Very High" },
        showTitle: false,
        width: "60%"
    });
    Properties like minValue, maxValue, numValues seem to be mandatory anyway, otherwise a slider between the range 1..100 is displayed. I suppose that if a properly set valueMap would work, I also would be able to get my first scenario working: by setting the value for items 2, 3 and 4 to an empty string, as illustrated below:

    Code:
    valueMap: { 1: "Low", 2: "", 3: "", 4: "", 5: "High" }
    Let me emphasize that I know that the SliderItem only supports numerical values, and there is nothing wrong with that. I just want to change the displayed caption(s) that the user is seeing.

    Do you have any idea how this problem can be properly solved in the coding above?

    Many thanks in advance for your valuable input!

    Kind regards,

    Rene Tran-Guillot

    #2
    See minValueLabel and maxValueLabel

    Comment


      #3
      Hello,

      Many thanks for this very prompt response; I must have overlooked minValueLabel and maxValueLabel. :S

      How about the feasibility of the scenario with all values displayed along the slider bar? ("Very Low".."Very High") Can you give a working example of SliderItem with the valueMap property?

      Kind regards,

      Rene Tran-Guillot

      Comment


        #4
        Unfortunately, that's not a supported usage - only min and max labels can be set - as the code currently stands, you also can't change the contents of the actual "valueLabel" that floats above the Slider.

        You could roll your own CanvasItem that behaves as you need, or we could add the features you need via the Feature Sponsorship program - http://www.smartclient.com/services/index.jsp#features.

        Comment


          #5
          Hello,

          Many thanks for this information. I'll work with the supported usage as it is available now and mitigate the feature gap. This thread can be considered as closed from my POV.

          Thanks again, and kind regards.

          Rene Tran-Guillot

          Comment

          Working...
          X