Author Topic: Function + Home Shortcut Key  (Read 2656 times)

Akihiro Inoue

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 32
    • View Profile
Function + Home Shortcut Key
« on: October 10, 2017, 01:24:50 pm »
Dear Team,

If we press Function Key+ Home   from last cell, the control is automatically moved to first cell.  No Issue with Scroll bar.

But, if the columns are frozen (For example 5 columns) and if we press Function Key+Home, then the control is transferred to first cell and horizontal scroll is not moved to first column and scroll stays in last column.

Please suggest me to fix this issue.





paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Function + Home Shortcut Key
« Reply #1 on: October 10, 2017, 04:39:40 pm »
Home key is designed to set focus on first cell, not to move the scrollbar.

scrollbar is moved when it's required to, in 2nd case scrollbar is not required to move.

Akihiro Inoue

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Function + Home Shortcut Key
« Reply #2 on: October 10, 2017, 05:20:18 pm »
Dear Team,

Thank you for your response.

scrollbar is moved when it's required to, in 2nd case scrollbar is not required to move
Please suggest me a work around to fix this scenario as it is required for our case.

i.e., Please let us know the event and api to move scrollbar to first

Thanks in advance

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Function + Home Shortcut Key
« Reply #3 on: October 11, 2017, 09:28:58 am »
The event is cellKeyDown, key is $.ui.keyCode.HOME and way to scroll the grid is get instance of scrollbar, set cur_pos and call scroll().

Example on how to scroll programmatically: https://paramquery.com/pro/demos/scroll

Code: [Select]
cellKeyDown: function(evt, ui){
if(evt.keyCode == $.ui.keyCode.HOME){
var hscroll = this.hscrollbar();
hscroll.option("cur_pos", 0);
hscroll.scroll();
}
},

This is for virtual mode only.