We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Choose option in dropdown using keys

Hi. 
I have grid with edit like excel.
In edit and create mode I pass through fields and change their values using TAB key, but when I want changed value of dropdown field I must use mouse. I really need some way to use only keys for edit values of dropdown field.

Maybe some auto-expand dropdown list when I focus on It by TAB ? Or something else which let me pass through dropdown options and checked one of them.

7 Replies

JA Jarek October 11, 2013 02:44 PM UTC

Ok, I resolve this problem this way:

    $(document).ready(function () {
        $(window).keydown(function (e) {
            if (e.keyCode == '32') {

                if ($('#selectid').val()== "opt1")
                    $('#selectid').val("opt2");
                else if ($('#selectid').val() == "opt2")
                    $('#selectid').val("opt1");
            }
        });
    });

So, when I press spacebar (code 32) on focused (focusing by TAB key) dropdown, value is changed to another. But it's hardcode solution. It's good in my app (i have only 2 or max 3 option) but please answer If someone know best resolution for this.


BM Bala Murugan A.S Syncfusion Team October 14, 2013 05:36 AM UTC

Hi Jarek,

 

Thanks for using Syncfusion Products.

 

We suggest you to use up/down arrow keys to change the values of the dropdown when you editing a cell. We have prepared a video demonstration for this and the same can be downloaded from the below link.

 

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/DropDown_ExcelEdit757982060.zip

 

Please let us know if you need any further assistance.

 

Regards,

Balamurugan A.S



JA Jarek October 14, 2013 07:32 AM UTC

Hi, thanks for reply.

I tried arrow keys before I create this post but with no result.

Now I see that in sample (http://mvc.syncfusion.com/demos/ui/grid/Editing/ExcelEdit) It is work perfect (like in your video) but on my grid on focused select:
Left/right arrow - nothing happen
Up/Down arrow - change record selected (next or previous)

Have you some ideas? 


JA Jarek October 14, 2013 10:51 AM UTC

I detect that in focused dropdown (select) I can't capture arrow keys - maybe some default function for changing values in dropdown also can't capture arrowkeys but why ?

I can capture other keys in dropdown but not arrows. But when I focused on textbox or something other field then I can capture arrow keys.






BM Bala Murugan A.S Syncfusion Team October 17, 2013 04:39 AM UTC

Hi Jarek,

Thanks for your update.

We regret to let you know that we are unable to reproduce your issue in our end. Could you please provide a simple sample which will reproduce your issue with more information(video with replication procedure) on you issue so that we could able to sort out the cause of this issue and provide you a better solution quickly?. then information provided would be a great help for us to resolve your issue.

Please let us know if you have any concerns.

Regards,
Balamurugan A.S


JA Jarek October 18, 2013 11:20 AM UTC

Hi.

On the trial 11.3.0.30 my example run ok.
On my 11.1.0.21 licensed version arrows work like I said. 

So it's possible that on 11.1.0.21 I can't use arrows to navigate on dropdown in grid ?


AS Alan Sangeeth S Syncfusion Team October 22, 2013 07:33 AM UTC

Hi Jarek,

Thanks for the update.

We are sorry for the inconvenience caused.

We are able to reproduce your issue in our end (pressing down/up arrow keys in dropdown then the values are changed but the selection moves to next/previous rows). We have prepared a video to demonstrate this and the same can be downloaded from the below link.

Video:

https://s3.amazonaws.com/files2.syncfusion.com/dtsupport/directtrac/general/DropDownEdit-761943563.zip

Could you please have a look at the above video and confirm whether you are facing the same in your end?

Please let us know if you have any concerns.

Regards,

Alan Sangeeth S


Loader.
Live Chat Icon For mobile
Up arrow icon