Well,
I would like to use the keyboard to navigate in the grid - something like this here:
https://fiddle.sencha.com/#fiddle/ron&view/editor
Can this be done without changing the source code ?
If not - I found the place where to modify the DBGrid - I just need to
find the please to inject the following code into the "Ext.application({"
Can you give me a tipp on how to do this ?
Thanks
Nils
----- functions I would like to inject ----
function getDirection(e) {
if (e.getKey() == e.LEFT) return 'left'
else if (e.getKey() == e.RIGHT) return 'right'
else if (e.getKey() == e.UP) return 'up'
else if (e.getKey() == e.DOWN || e.getKey() == e.ENTER) return 'down'
}
function specialKeyFunction(field, e) {
console.log(field);
var grid = field.up('grid')
var pos, newPos, cellMod;
cellMod = grid.selModel;
pos = grid.selModel.getCurrentPosition();
var dir = getDirection(e);
if (pos) {
newPos = pos.view.walkCells(pos, dir, e, cellMod.preventWrap);
if (newPos) {
newPos.view = pos.view;
cellMod.setCurrentPosition(newPos);
}
}
Ext.defer(function() {
grid.editingPlugin.startEdit(newPos.row, newPos.column);
}, 100)
};