poff

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • poff
    Participant


    @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;

    in reply to: Binding additional keyboard events in Cell Editing mode #102110
    poff
    Participant

    @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.

Viewing 2 replies - 1 through 2 (of 2 total)

Stay connected with us in your favorite flavor!