Hi, I've been looking a way to do that, i can manage it with igNumericEditor but not with igCombo.
$("#ddlMonedaMonto").igCombo({ dataSource: data, valueKey: "IdMoneda", textKey: "Nombre", selectedItems: [{ index: 0 }], //default moneda = USD keydown: function (evt, ui) { if (ui.key == 13) { $(document.activeElement).closest(".input-group").next().find("input").focus() } } });
dataSource: data, valueKey: "IdMoneda", textKey: "Nombre", selectedItems: [{ index: 0 }], //default moneda = USD keydown: function (evt, ui) { if (ui.key == 13) { $(document.activeElement).closest(".input-group").next().find("input").focus() } } });
Hello Mario ,
Thank you for posting in our forum.
The ui object does not have a key property. Instead it has a keyCode property that contains the code of the key that was pressed.
So the keydown event should look like this:
keydown: function (evt, ui) {
if (ui.keyCode == 13) {
//...
}
Let me know if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Hi, thanks for answer, now the enterkey press is detected but the igCombo instead of change focus, displays/hide the dropdownList of options.
Is there any way to avoid this behavior?
thanks!
I’ve tested this on my side by directly selecting the next input on the page and setting the focus to it:
console.log("Enter");
$("#input1").focus();
And didn’t encounter a similar issue.
I’ve attached the sample I used to test this. Please test it on your side and let me know if you encounter any issues with it.
If it works as expected on your side then I suggest you check whether the your selector ($(document.activeElement).closest(".input-group").next().find("input").focus() ) is returning the correct element.
Otherwise the issue is possibly specific to your environment or the specific version of the controls that you’re using. If that’s the case please let me know the exact browser version and the exact version of IgniteUI that you’re currently using.
I’m looking forward to your reply.
Thanks Maya, i've tested your example in chrome and IE9 and the issue persist.When focus is on comboBox and select an option, if ENTER key is pressed the focus is not given to the next input, instead the listbox of the combo is open and closed with each keydown event.
:(
Thank you for the clarification. I was able to reproduce this after an item from the drop down is selected and Enter is hit.
Due to the autocomplete functionality of the combo when the enter key is pressed the item that matches the current text in the editor is selected, which is why the editor opens and closes when there’s text in it and you hit enter. If you want to prevent this you can cancel the keydown event by returning false in it. For example:
return false;
Let me know if you have any questions or concerns regarding this.
That's it!
thanks for your help Maya ;-)
-Mario Araya-