Forum
15:56
21/07/2014
Hi,
Is it somehow possible to bind new keyboard events to the grid in Cell Editing mode, in addition to those that are predefined for key navigation? I've tried to use the bindKeys method, and binding a keydown event to the grid, but neither of them seem to work. Both of them work fine when cell editing is not active though.
Am I missing something here, or is it not possible to bind additional keyboard events when using cell editing?
Thank you for the excellent grid plugin!
21:04
Moderators
30/10/2007
Hello,
Â
Can you please let me know what is your goal?
What you try to do - just let me know about the problem you should resolve.
Â
Kind Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:41
21/07/2014
tony said
Can you please let me know what is your goal?What you try to do - just let me know about the problem you should resolve.
I would like to add the possibility for the user to navigate through grid pages with Page Up and Page Down keys. I found instructions on how to do this on this stack overflow answer, but the keydown event does not seem to fire in cell editing mode.
14:35
Moderators
30/10/2007
Hello,
I understand and this time is very easy to answer.
Since you are in celledit mode you are in a table cells.
Keydown by default can not be applied to table cells.
In jqGrid we use a trick to create a hidden div inside grid and make a keydown to it.
Currently you can look at GridNav method (which do this job in celledit mode) and make the needed changes for pageup pagedown keys.
Â
Kind Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
16:39
21/07/2014
tony said
Currently you can look at GridNav method (which do this job in celledit mode) and make the needed changes for pageup pagedown keys.
Thank you!
In case someone else is searching for a way to do this, here is what I ended up with, added to the switch statement inside GridNav function:
case 36: // Home - First page
 var pager = $($t).jqGrid('getGridParam', "pager");
 var page = $($t).jqGrid('getGridParam', "page");
 if (pager && page !== 1) {
   $($t).jqGrid('setGridParam', { "page": 1 }).trigger("reloadGrid");
 }
break;
case 34: // Page Down - Previous page
 var pager = $($t).jqGrid('getGridParam', "pager");
 var page = $($t).jqGrid('getGridParam', "page");
 if (pager && page > 1) {
   $($t).jqGrid('setGridParam', { "page": page - 1 }).trigger("reloadGrid");
 }
break;
case 33: // Page Up - Next page
 var pager   = $($t).jqGrid('getGridParam', "pager");
 var page    = $($t).jqGrid('getGridParam', "page");
 var lastpage = $($t).jqGrid('getGridParam', "lastpage");
 if (pager && page < lastpage) {
   $($t).jqGrid('setGridParam', { "page": page + 1 }).trigger("reloadGrid");
 }
break;
case 35: // End - Last page
 var pager   = $($t).jqGrid('getGridParam', "pager");
 var page    = $($t).jqGrid('getGridParam', "page");
 var lastpage = $($t).jqGrid('getGridParam', "lastpage");
 if (pager && page !== lastpage) {
   $($t).jqGrid('setGridParam', { "page": lastpage }).trigger("reloadGrid");
 }
break;
14:46
Moderators
30/10/2007
Hello,
Â
Thanks for the feedback and the code posted.
Â
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
43 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66