Skip to content

Instantly share code, notes, and snippets.

@trozdol
Created November 18, 2020 22:27
Show Gist options
  • Select an option

  • Save trozdol/1b8dcfa323a098ca42ef1e3abea0448c to your computer and use it in GitHub Desktop.

Select an option

Save trozdol/1b8dcfa323a098ca42ef1e3abea0448c to your computer and use it in GitHub Desktop.
Bug Fix Ext.grid.plugin.CellEditing class when tabbing through grid cells and not all cells are editable.
Ext.define('Ext.grid.plugin.CellEditing', {
override: 'Ext.grid.plugin.CellEditing',
activateCell: function(location) {
var me = this,
activeEditor = me.activeEditor,
previousEditor = me.$previousEditor,
editor, selModel, result;
if (!location) {
Ext.raise('A grid Location must be passed into CellEditing#activateCell');
}
// BUG FIX:
// activeEditor.$activeLocation could be null
// resulting in an error checking for the value of cell.
//
if (activeEditor && activeEditor.getLocation() && activeEditor.getLocation().getCell() === location.getCell()) {
return activeEditor.getLocation();
} else {
editor = me.getEditor(location);
if (editor) {
if (previousEditor) {
if (previousEditor.isCancelling) {
previousEditor.cancelEdit();
} else {
previousEditor.completeEdit();
}
}
result = editor.startEdit(location);
if (editor.editing) {
if (me.getSelectOnEdit()) {
selModel = me.getGrid().getSelectable();
if (selModel.getCells()) {
selModel.selectCells(location, location);
} else if (selModel.getRows()) {
selModel.select(location.record);
}
}
me.$previousEditor = editor;
return result;
} else {
editor.onEditComplete(false, true);
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment