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

Assign Events on client-side

3 Answers 107 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Doug Rutledge
Top achievements
Rank 1
Doug Rutledge asked on 17 Jul 2008, 10:10 PM
The online documentation states that we can add client side event handlers using client side code.   This works great for the onClientBlur and onClientFocus events.  However, I get an error when I try to do the same for the OnClientSelectedIndexChanged event, as well as some of the others.  Does the RadComboBox not support "add_<event name> " methods for all client side events?  If not, which ones does it support?

Here is what my code looks like:
<script> 
function indexChangedHandler()  
{  
    alert("changed");  
}  
 
// I'm doing it this way because the application framework is attaching this event  
// undercertain circumstances and I was trying to see if I could add multiple event  
// handlers using this mechanism  
Sys.Application.add_load(      
function () {  
var combo = $find("RadComboBox1");  
combo.add_onClientSelectedIndexChanged(indexChangedHandler);  
}      
 
);  
</script> 
 
</script> 

Thanks,
Doug Rutledge

3 Answers, 1 is accepted

Sort by
0
Accepted
Rosi
Telerik team
answered on 18 Jul 2008, 07:21 AM
Hello Doug ,

This works as expected at our side. Please see the attached project for more details.

You can use the add_<event name>(<event handler>) approach for all client side events of RadComboBox.

Kind regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug Rutledge
Top achievements
Rank 1
answered on 18 Jul 2008, 02:03 PM
Thanks for the sample.  I didn't realize that some events had to be added using "add_onClient<event>" naming scheme while others had to be added without the "onClient" prefix.  For instance, add_onClientBlur works but add_blur does not and add_selectedIndexChanged works but add_onClientSelectedIndexChanged does not.  The events are all named with the "OnClient" prefix.  Also, the example in the online documentation uses the OnClientBlur event, which is added via "add_onClientBlur", which makes it appear that all should be added using  "add_onClient<event>" scheme.  It does not make note that some are added without the "onClient" prefix.  So, it's not very clear when to use which naming scheme.  I would think some consistency would be good or at least an update to the online documentation stating that some do not need the "onClient" prefix.  Unless I've missed some documentation somewhere, that is.

Thanks again.
Doug
0
Rosi
Telerik team
answered on 18 Jul 2008, 03:11 PM
Hello Doug ,

Thank you  for bringing this to our attention.

We will update the documentation and add more details.


Kind regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Doug Rutledge
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Doug Rutledge
Top achievements
Rank 1
Share this question
or