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

how to track keypress event on combobox

4 Answers 961 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
parthiv
Top achievements
Rank 1
Iron
parthiv asked on 18 Jul 2013, 07:28 PM
Hello Support,

I want to trace, entry key press on combobox. I am not able to achieve that, please let me know how could I achieve this.

Thanks,
Parthiv

4 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 19 Jul 2013, 03:09 PM
Hello Parthiv,

You can use the jQuery focus() method to check when the combobox is focused, and attach it to the input that is actually holding the Kendo UI Combobox. 

$("#YourComboBox").data("kendoComboBox").input.focus(function(){
            console.log("focus");
          });

 

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
Ali
Top achievements
Rank 1
answered on 23 Feb 2016, 04:26 AM

Hi Kiril,

It is not working in my case. I want to call key press event in kendo combobox. Please consider my example:

ComboBox:

@(Html.Kendo().ComboBox()
                    .Name("cmbChopOwnerAssistance")
                    .DataTextField("Name")
                    .DataValueField("Id")
                    .HtmlAttributes(new { style = "width:380px;" })
                    .Filter("contains")                    
                )

In Javascript:

 $.ajax({
            url: '@Url.Action("LoadUsers", "List")',
            type: 'GET',
            cache: false,
            data: { UserId: AssistantId },
            success: function (data) {                                          
                $("#cmbChopOwnerAssistance").kendoComboBox({
                    dataTextField: "Name",
                    dataValueField: "Id",
                    dataSource: data                    
                });
            }
        });

 

Thank you for your help.

0
Ali
Top achievements
Rank 1
answered on 23 Feb 2016, 04:52 AM

Dear Kiril,

It is resolved by using the following example:

http://docs.telerik.com/kendo-ui/api/javascript/ui/combobox

Thank you so much for your time.

0
Kiril Nikolov
Telerik team
answered on 23 Feb 2016, 08:55 AM
Hello Muhammad,

I am happy to hear that the problem has been resolved. In case you have any further questions do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
parthiv
Top achievements
Rank 1
Iron
Answers by
Kiril Nikolov
Telerik team
Ali
Top achievements
Rank 1
Share this question
or