This is a migrated thread and some comments may be shown as answers.

Getting the value for each range slider

1 Answer 88 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 11 Aug 2010, 09:16 AM

Hi,

 

 Have a range slider I use for a date range (years), this has two handles ‘From’ and ’To’, I need to be able to track these two slider values so I can write them each to divs (two separate divs). I’ve got it working with one slider but can’t work out how to capture the second slider value, I hope you can help. Here is my code:



From <span class="SearchHeaderNumbers"><asp:label runat="server" ID="litDateFrom" ClientIDMode="Static" Text="" /></span> to <span class="SearchHeaderNumbers"><asp:label runat="server" ID="litDateTo" ClientIDMode="Static" Text="" /></span><br />
                        <div class="DateRange">
                            <telerik:RadSlider ID="rsDateRange" runat="server" AutoPostBack="true" BackColor="#F5F5F5" EnableEmbeddedSkins="true" SelectionStart="1996" ItemType="Tick" OnClientValueChanging="clientValueChange" ShowDecreaseHandle="false" ShowIncreaseHandle="false" SelectionEnd="2010" IsSelectionRangeEnabled="true" LiveDrag="true" DragText="" MinimumValue="1996" MaximumValue="2010" Width="167px" />
                        </div>

 

 

 

 

                            <script language="javascript" type="text/javascript">
  
                        function clientValueChange(sender, eventArgs) {
                            var myDateFrom = document.getElementById("litDateFrom")
                            myDateFrom.innerHTML = sender.get_value();
  
                            var myDateTo = document.getElementById("litDateTo")
                            // myDateFrom.innerHTML = ??? Some code ???
                        }
                      
                    </script>


as I mentioned I can get the value from sender.get_value() which which gives me the value for the start slider but the end slider I'm lost about.

Thanks
Ed

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 12 Aug 2010, 03:41 PM
Hi Ed,
In this case, you should use the get_selectionStart and get_selectionEnd client-side methods of RadSlider. Please refer to our online documentation for additional information on the client-side API of the control:

http://www.telerik.com/help/aspnet-ajax/slider_clientobject.html


Regards,
Tsvetie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Slider
Asked by
Andrew
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or