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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Ability to give expand/collapse nodes focus

Thread ID:

Created:

Updated:

Platform:

Replies:

121777 Jan 25,2016 08:48 AM Jan 26,2016 04:57 AM JavaScript 1
loading
Tags: ejGrid
Greg Gannicott
Asked On January 25, 2016 08:48 AM

Hi.

Would it be possible to add the ability to give the expand/collapse nodes focus via the keyboard please?

Thanks for reading.

Balaji Marimuthu [Syncfusion]
Replied On January 26, 2016 04:57 AM

Hi Greg,

Thanks for contacting Syncfusion support.

Yes, we can able to focus the expand/collapse nodes in Grid using the jQuery focus method. Refer to the sample and code example as below.
Sample: http://jsplayground.syncfusion.com/l4tw4v2s



<script type="text/javascript">

       

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

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

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

            }


        });

        $("#Grid").on("keydown", function (e) {

            var obj = $("#Grid").ejGrid("instance"), cell;


            if (e.shiftKey) {


                if (e.keyCode == 68) { //shift+D

                    var ele = obj.getContentTable().find("td[class^='e-recordplus']"); //grouping

                    //var ele1 = obj.getContentTable().find("td[class^='e-detailrow']");  //if use detail template or hierarchy

                    $(ele[0]).attr("tabindex", 0);

                    $(ele[0]).focus();

                }

            }

        });
    </script>


Please find the keys to focus expand/ collapse node.

Grid focus
Alt + j
Expand/Collapse node
Shift + d


If you want to perform the Expand and collapse operation using the keyboard, we have a default support. So please refer to the demo and documentation in following link.

Demo: http://js.syncfusion.com/demos/web/#!/azure/grid/KeyboardInteraction

Document: http://help.syncfusion.com/js/grid/accessibility

Regards,
Balaji Marimuthu

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

;