1
votes

I'm using an HSlider with 2 thumbs. How do I set the maximum distance that the thumbs can be apart? (I don't mean the min. and max. values of slider track's full length).

In my case, I'm using dates. But let's say that the full slider track length goes from 0 to 100. How do I make it so that the maximum distance thumb A can be from thumb B at anytime is 30? So, the user can select a range from 0 up to 30 anywhere on the track.

<code:HSlider id="dateRange" 
    allowThumbOverlap="true" thumbCount="2" showDataTip="false"
    liveDragging="true" lockRegionsWhileDragging="true"
    change="dateChange();"  
    showTrackHighlight="true" tickThickness="5"  width="100%"
     />

Any suggestions?

1

1 Answers

1
votes

Either you extend HSlider to add a property for that which checks if it goes beyond that when the user changes it (with the change property) or you just check it in the dateChange function and make sure it's within bounds. If not, set the value manually.