To provide quick access to particular functions of applications we can implement so called hot keys. ExtJs provides different mechanisms to achieve this functionality, here I will show you how to use‘Ext.util.KeyMap’ class for these purposes. KeyMap will be initialized in the ViewController but for huge applications you can put it in a separate class. Another question is which element will be attached to the KeyMap: Grid or Toolbar, this decision I will leave up to you.
The following hotkeys are implemented:
- a – select all rows
- d – delete selected row(s)
- ctrl + d – delete all the rows
- r – reload the grid