Skip navigation
BaileyBurger
Currently Being Moderated

How to reverse HSlider values?

May 14, 2009 9:05 PM

Greetings!

 

I've got a panel that contains 5 different sliders allowing the user to set various thresholds. I'd like to convey to the user that moving sliders to the right will always yield a greater result, to the left a lesser result. But to do so, one of the sliders has to offer reversed / decreasing values. Is there a way to do this? In other words, can I have the slider values reading from left to right 50,40,30,20,10,0?

 

Thanks,

 
Replies
  • Currently Being Moderated
    May 15, 2009 12:59 AM   in reply to BaileyBurger

    Hi there,

     

    I don't think there's a built in feature for what you want. My best hint would be to create your own component and make it function the way you want. You could try extending the HScroller and see if the method that control the measurement and the placement of data can be overriddent. If they can be overridden then all you need to do is reverse the way it calculates the values when you move the scroll head.

     

    With best regards,

    Barna Biro

    Blog: http://blog.wisebisoft.com

     

    EDIT: I just took a look and it seems that most of the stuff can be overridden so you should be able to replace the existing calculations with your own. I can't think of a better way to do this.

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2009 1:26 AM   in reply to BaileyBurger

    Hi,

     

    as a workaround for your task can set negative value and get abs from the value.

    So you need to inverse data: set minimum to -50 and max to 0.

    Also you need to set function dataTipFormatFunction and others to show user only positive values.

     

    Also you can create your own extendedSlider to reverse all data this way.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 16, 2013 6:38 AM   in reply to BaileyBurger

    Hey there,

     

    I know it has been a long time since this issue has been posted. But since I found a workaround, I thought it could be nice for eventual people encoutering the same problem to come here finding the answer...

     

    Using the spark slider classes, HSlider for instance, the solution is utterly simple : just use layout mirroring with the layoutDirection property, and set it to rtl for "right to left" or ltr for "left to right" according to your needs.

     

    Cheers!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points