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

How to handle keydown event

5 Answers 1452 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Enrique
Top achievements
Rank 1
Enrique asked on 18 Nov 2014, 10:35 PM
Hello, 

How can I handle the keydown event in a dropdownlist control?

The only thing I could handle so far is the "change" event, but I need to do something when the user press the "enter" key within a dropdownlist EVEN if the value has not changed.

Thank you in advance, 

Regards

5 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 20 Nov 2014, 09:01 AM
Hello Enrique,

The enter key is being intercepted by the widget and returns, as you can see in the following line of the code:

https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.list.js#L873

So if you want to do some logic on enter key, you can include some logic inside or execute your custom function.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrique
Top achievements
Rank 1
answered on 20 Nov 2014, 07:48 PM
I am afraid this is the worse solution for me. :(

Because what happen when I do an upgrade ? I will need to apply this custom line again..
Other issue is I use the kendo.web.min, so, to do the test for this change I will need to use the individual .js libraries.. Then I will need to create a modified kendo.web.min.
This lead me to another question, how I can create the kendo.web.min file again? 

thanks.
0
Kiril Nikolov
Telerik team
answered on 24 Nov 2014, 11:19 AM
Hello Enrique,

I think I found a more elegant solution for your scenario, please check it out:

http://dojo.telerik.com/AZUnE

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Enrique
Top achievements
Rank 1
answered on 26 Nov 2014, 12:45 AM
That is (by far) a better solution !  Thank you very much. 
I will try to incorporate it to my custom controls. I will re-open if an additional issues occur. 

Good work. Thanks again for your help.
Regards
0
Kiril Nikolov
Telerik team
answered on 27 Nov 2014, 11:24 AM
Hello Enrique,

I am happy to hear that the proposed solution helped.

In case you have any further questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
Enrique
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Enrique
Top achievements
Rank 1
Share this question
or