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

Slider in RadToolbar :-( !!

1 Answer 76 Views
Slider
This is a migrated thread and some comments may be shown as answers.
PapaSmurf
Top achievements
Rank 2
PapaSmurf asked on 12 Jun 2008, 11:14 PM
Hi,

i'm using the slider in a radToolbar as toolbarbutton > Itemptemplate.
Bu i can't set the value of the slider in javascript! 
I use the following code to get the slider clientID in toolbartemplate item.
The zoomslider is an object, but it throws an exception on get_value() or on set_Value..  (object doesn't support the property or method).

var ZoomSlider = document.getElementById('<%=MapToolBar.FindItemByValue("MapSlider").FindControl("ZoomSlider").ClientID%>');

if (ZoomSlider != null) {ZoomSlider .set_Value(17);}

Please help?

Cheers

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 16 Jun 2008, 11:08 AM
Hi BarbaPapa,

I already answered your support ticket and for your convenience I am pasting my reply below.

I examined your code and I noticed that you are using the built-in javascript function getElementById. It obtains a reference to an HTML element and in order to use the RadSlider's client-side methods you should reference the client object. This should be done by using the built-in ajax method $find.

In order to achieve the desired behavior you should change your code in the following manner:

 var ZoomSlider = $find('[Your_Slider_ClientID]');   
           if (ZoomSlider != null)   
           {  
              ZoomSlider .set_value(17);  
           }  


Regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Slider
Asked by
PapaSmurf
Top achievements
Rank 2
Answers by
Svetlina Anati
Telerik team
Share this question
or