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

"alt + j" keyboard shortcut does not work when two or more grids are present on a single page

Hi.

We are unable to use the suggested keyboard shortcut of 'alt + j' to give a grid focus when there is more than one grid on screen.

Is there currently a solution to this, or is it something you could work into the product please?

Many thanks.

1 Reply

MF Mohammed Farook J Syncfusion Team January 25, 2016 11:11 AM UTC

Hi Greg,

We have validate your requirement and  we have achieved your requirement by workaround. Please find the code snippet.


<div id="Grid"></div><br /><br />
<div id="Grid1"></div>

<script type="text/javascript">

        $(function () {

            $("#Grid").ejGrid({

                // the datasource "window.gridData" is referred from jsondata.min.js

                dataSource: ej.DataManager(window.gridData).executeLocal(ej.Query().take(300)),

                allowGrouping: true,

                allowPaging: true,

. . .

                ]

            });

            $("#Grid1").ejGrid({

                // the datasource "window.gridData" is referred from jsondata.min.js

                dataSource: window.employeeView,

                allowGrouping: true,

                . . .

                                           

            });

            //Control focus key

            $(document).on("keydown", function (e) {

                if (e.altKey && e.keyCode === 74) { // j- key code.

                    $("#Grid").focus();

                }

                if (e.altKey && e.keyCode === 75) { // k- key code.

                    $("#Grid1").focus();

                }

            });


        });
    </script>


In above code snippet we have achieved your requirement through “keydown” event. You can able to focus multiple Grid element through jquery focus() with specific id selector. For your convenience we have a prepared a sample and please find the following link:

Sample :  http://jsplayground.syncfusion.com/n3jhvv4o


Please let us know if you have any queries.

Regards,
J.Mohammed Farook

Loader.
Up arrow icon