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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

121761 Jan 22,2016 10:43 AM UTC Jan 25,2016 11:11 AM UTC JavaScript 1
loading
Tags: ejGrid
Greg Gannicott
Asked On January 22, 2016 10:43 AM UTC

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.

Mohammed Farook J [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;