commit c3c789da5f3706a4d1d7ccfbe184b09fc7c70d3f
parent 53ca8b61344fa8f4f6a5c40cca062c885ec2d66e
Author: Felicitus <felicitus@felicitus.org>
Date: Wed, 4 Jul 2012 23:33:07 +0200
Grid-related fixes due to ExtJS 4.1
Diffstat:
4 files changed, 5 insertions(+), 55 deletions(-)
diff --git a/src/frontend/js/Components/Part/Editor/PartDistributorGrid.js b/src/frontend/js/Components/Part/Editor/PartDistributorGrid.js
@@ -95,7 +95,7 @@ Ext.define('PartKeepr.PartDistributorGrid', {
this);
this.on("edit", this.onEdit, this);
},
- onEdit : function(data) {
+ onEdit : function(editor, data) {
var id = data.record.get("distributor_id");
var rec = PartKeepr.getApplication().getDistributorStore().findRecord("id", id);
diff --git a/src/frontend/js/Components/Part/Editor/PartManufacturerGrid.js b/src/frontend/js/Components/Part/Editor/PartManufacturerGrid.js
@@ -67,7 +67,7 @@ Ext.define('PartKeepr.PartManufacturerGrid', {
this.getSelectionModel().on('selectionchange', this.onSelectChange, this);
this.on("edit", this.onEdit, this);
},
- onEdit: function (data) {
+ onEdit: function (editor, data) {
var id = data.record.get("manufacturer_id");
var rec = PartKeepr.getApplication().getManufacturerStore().findRecord("id", id);
diff --git a/src/frontend/js/Components/Part/Editor/PartParameterGrid.js b/src/frontend/js/Components/Part/Editor/PartParameterGrid.js
@@ -132,11 +132,11 @@ Ext.define('PartKeepr.PartParameterGrid', {
this.deleteButton.setDisabled(selections.length === 0);
},
onBeforeEdit: function (editor, e, o) {
- var header = this.headerCt.getHeaderAtIndex(editor.colIdx);
+ var header = this.headerCt.getHeaderAtIndex(e.colIdx);
var edit = this.editing.getEditor(editor.record, header);
- if (editor.field == "prefixedValue") {
- var unit = PartKeepr.getApplication().getUnitStore().getById(editor.record.get("unit_id"));
+ if (e.field == "prefixedValue") {
+ var unit = PartKeepr.getApplication().getUnitStore().getById(e.record.get("unit_id"));
if (unit) {
edit.field.setStore(unit.prefixes());
}
diff --git a/src/frontend/js/ExtJS/Bugfixes/Ext.grid.plugin.CellEditing-EXTJSIV-3318.js b/src/frontend/js/ExtJS/Bugfixes/Ext.grid.plugin.CellEditing-EXTJSIV-3318.js
@@ -1,49 +0,0 @@
-/**
- * This is a hackish bugfix for ExtJS 4.0.7. According to sencha, this has been fixed in EXTJSIV-3318. Remove this
- * as soon as a newer version as ExtJS 4.0.7 is out and fixes this bug.
- */
-Ext.override(Ext.grid.plugin.CellEditing, {
-
- startEdit: function(record, columnHeader) {
- var me = this,
- value = record.get(columnHeader.dataIndex),
- context = me.getEditingContext(record, columnHeader),
- ed;
-
- record = context.record;
- columnHeader = context.column;
-
-
-
- me.completeEdit();
-
- context.originalValue = context.value = value;
- if (me.beforeEdit(context) === false || me.fireEvent('beforeedit', context) === false || context.cancel) {
- return false;
- }
-
-
- if (columnHeader && (!columnHeader.getEditor || !columnHeader.getEditor(record))) {
- return false;
- }
-
- ed = me.getEditor(record, columnHeader);
- if (ed) {
- me.context = context;
- me.setActiveEditor(ed);
- me.setActiveRecord(record);
- me.setActiveColumn(columnHeader);
-
-
- me.editTask.delay(15, ed.startEdit, ed, [me.getCell(record, columnHeader), value]);
- } else {
-
-
-
-
- me.grid.getView().getEl(columnHeader).focus((Ext.isWebKit || Ext.isIE) ? 10 : false);
- }
-
- return true;
- }
-});-
\ No newline at end of file