I'm looking for suggestion on how to assign a keyMap to a grid. TopRacers Translation Tool:: There is a car on the grid with problems, we hope it is nothing important. Valid: Valid Translation Valid: Most Popular Suggestion. http://community.topracers.net/list.php?category=untrans&page=1&page=16&page=16&page=6&edit_all=yesHOME |
What I'm trying to do is assign some keys to the grid (for instance if grid body has focus the DELETE key will delete selected row). Or maybe ctrl-P if the grid panel has focus
I'm a little weak on how to get the appropriate element or which element to hook into.
I tried several, and searched the forums without much more success.
var map = new Ext.KeyMap(
mapEl,//the element to bind to UNITED STATES OF AMERICA 114 FERC ΒΆ62280 FEDERAL ENERGY REGULATORY :: File Format: PDF/Adobe Acrobat - View as HTMLUsing the township grid provided on the form, identify the section (s), those cases where FERC has not assigned sheet numbers, assign letter http://www.ipchydro.org/pdfs/bliss/license/lic20060321.pdfHOME | Akai MPC Forums - JJ OS Feature Requests : MPC1000 - Unofficial JJ OS:: To keymap a certain sample to certain pads at a time. Piano roll edit for MIDI/keygroup tracks in addition to the grid edit for drum tracks http://www.mpc-forums.com/viewtopic.php?f=25&t=77422&start=0HOME |
key:'a',//just for testing, not sure what delete key would be referred to
...
);
//this works
var mapEl = document;//works, but too far up tree? (if I'm outside of grid don't want this key listened to)
//these didn't work:
var mapEl = grid.getEl();
var mapEl = Ext.select('x-panel-body');//this is the body of grid but didn't work
var mapEl = Ext.select('myGridID');//id of the grid assigned in html
var mapEl = grid.getGridEl();
Its good to hear that im not the only one that tries to add a keymap to an element that doesn't exist yet :) but im surprised you didn't get a js error in firebug when you did that.
If you need to know what other keys are, you can take a look at the EventObject in the API reference, it lists them out.
try using grid.body
ps, the delete key is 46
Thanks. That worked, but so did my original. Turns out I placed that code before the grid was loaded, so I guess the dom wasn't ready yet (as opposed to 'document' which was ready. Once I moved those lines after the grid was rendered it worked ok.
At first I didn't think your proposal would work, because firebug showed grid.body as an object, not an element. It works though.
works:
var mapEl = grid.getEl();
also works:
var mapEl = grid.body;
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|