Author Topic: Hi. some question, keyboard left, right key -> How horizonScroll Control ?  (Read 3129 times)

codexyz

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hi.

some question. How control horizonScroll by Keyboard(left, right).
-----------------------------------------------------
I set option

selectionModel: {type: 'row', mode: 'single' }
-----------------------------------------------------

keyboard left, right key -> How horizonScroll Control ?

now, keyboard left, right key -> next Row selected or prev Row selected.

ps) I'm not english very well. T,.T

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Hi. some question, keyboard left, right key -> How horizonScroll Control ?
« Reply #1 on: November 13, 2014, 10:58:15 am »
That's by design. Keyboard navigation works along with selectionModel.

If it's type = 'row' then left / right keys move the row selection up/down respectively.

codexyz

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Hi. some question, keyboard left, right key -> How horizonScroll Control ?
« Reply #2 on: November 13, 2014, 07:06:44 pm »
keyboard left, right key -> horizonScroll Control

i customized pqgrid PRO...

_pKeyNav._bodyKeyPressDown = function(evt) {

....

if (evt.keyCode == keyCodes.LEFT) {
   var decr = 0;

   if (SM.type == "row" && $(that.$hscroll)[0].style.display != 'none') {
      $(that.$hscroll).children('.left-btn').trigger('click');
      decr = 1;
   }
        var obj = this._decrIndx(rowIndxPage, colIndx);
   if (obj) {
      rowIndx = obj.rowIndxPage + offset + decr;
      this.select({
         rowIndx: rowIndx,
         colIndx: obj.colIndx,
         evt: evt
      })
   }
   evt.preventDefault();
   return
} else {
        if (evt.keyCode == keyCodes.RIGHT) {
      var incr = 0;
      
      if (SM.type == "row" && $(that.$hscroll)[0].style.display != 'none') {
         $(that.$hscroll).children('.right-btn').trigger('click');
         incr = -1;
      }
            
      var obj = this._incrIndx(rowIndxPage, colIndx);
      if (obj) {
         rowIndx = obj.rowIndxPage + offset + incr;
               
         this.select({
            rowIndx: rowIndx,
            colIndx: obj.colIndx,
            evt: evt
         })
      }
      evt.preventDefault();
      return
   } else {
       
        .....

}

......

keyboard left, right key -> horizonScroll Control very Well.

but, row focus(dotted box) missed.... T.T

What's a matter?
« Last Edit: November 13, 2014, 07:13:04 pm by codexyz »