I want to access grouping with keyboard

Technology must be angular JS and MVC

I want to access grouping buttons with keyboard

Please refer attachment

Attachment: grouping_with_keybaord_3d1e4195.rar

1 Reply

MS Madhu Sudhanan P Syncfusion Team September 17, 2015 10:54 AM UTC

Hi Rakesh,

Thanks for contacting Syncfusion products.

From the query we understood that you want to group/ungroup column using key board. To do so we can use the following code example to achieve the requirement.


<div class="gridStyle" ng-init="getList()" id="integratorTemplateGrid" ej-grid e-datasource="data"

             e-columns="columns" e-allowkeyboardnavigation="true" e-allowpaging="true"

             e-allowgrouping="true" e-allowfiltering="true" e-filtersettings-filtertype="excel" e-actioncomplete="actioncomplete">

        </div>
     

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

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

                    var currentcell = $("#integratorTemplateGrid").find(".e-activecell");

                   

                    if (e.shiftKey) {


                         if (e.keyCode == 71) { //shift + G - Group

                            var field = obj.getColumnByIndex(obj.model.groupSettings.groupedColumns.length)

                         

                            obj.groupColumn(field["field"]);

                        }


                        if (e.keyCode == 85) { //shift + U - Ungroup

                            var gc = obj.model.groupSettings.groupedColumns;

                            obj.ungroupColumn(gc[gc.length -1]);

                        }


                    }

                   . . . .
                });


We have also created a simple sample and the same can be downloaded from the below location.

Sample Location: http://www.syncfusion.com/downloads/support/forum/120244/ze/ang-key-1793485026

Regards,
Madhu Sudhanan. P

Loader.
Up arrow icon