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

[Solved] $addHandler

3 Answers 266 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Michael Tissington
Top achievements
Rank 1
Michael Tissington asked on 09 Dec 2007, 10:23 PM
I'm trying to use $addHandler to hook up some client side events but my event handlers are not getting called ...

Can you provide an example of using the $addHandler AJAX method to do this please.

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 10 Dec 2007, 08:25 AM
Hi Michael Tissington,

What event do you want to add? If it is, for an example, SelectedIndexChanged, you can do it, like:

combo.add_selectedIndexChanged("NameOfTheEventHandler");

Hope this helps.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Michael Tissington
Top achievements
Rank 1
answered on 10 Dec 2007, 01:30 PM
Hmm, thanks ... its is OnClientSelectedIndexChanged ... I have tried add_selectedIndexChanged and the code executes but my code does not catch the event ...

If I do 

rcb = $find("<%= SearchPanel.FindItemByValue("ItemWhat").FindControl("What").ClientID%>");

rcb.add_selectedIndexChanged("What_SelectedIndexChanged");

I get Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'String' cannot be converted to type 'Function'.
Parameter name: handler

And if I do similar without the quotes

rcb.add_selectedIndexChanged(What_SelectedIndexChanged);

the code executes but I do not catch the event.

0
Nikolay
Telerik team
answered on 11 Dec 2007, 09:50 AM
Hi Michael Tissington,

I prepared a small and running project for you. Attached, please find the files. Download them and give them a go.

I hope this will get you started.

Regards,
Nick
the Telerik team

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