details: https://code.openbravo.com/erp/devel/pi/rev/75d0f48b9623
changeset: 14768:75d0f48b9623
user: Martin Taal <martin.taal <at> openbravo.com>
date: Wed Nov 30 14:29:38 2011 +0100
summary: Fixes issue 19176: Grid editing problem
While the editor form is shown in the grid all kinds of focus/blur events
happen together with validation, this results in redraws, the code change
prevents the validation and
resulting redraws while the editor is being shown
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
| 6 ++++
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
| 3 +-
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
| 13 +++++++++-
3 files changed, 20 insertions(+), 2 deletions(-)
diffs (60 lines):
diff -r 736b6c531d88 -r 75d0f48b9623
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
Wed Nov 30 14:13:40 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
Wed Nov 30 14:29:38 2011 +0100
@@ -429,6 +429,12 @@
blur: function(){
var value;
+ // prevent validation/blurhandling when we are showing the editor and
moving
+ // the focus around
+ if (this.form && this.form.grid && this.form.grid._showingEditor) {
+ return;
+ }
+
if (this.doBlurLogic) {
this.validate();
diff -r 736b6c531d88 -r 75d0f48b9623
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
Wed Nov 30 14:13:40 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
Wed Nov 30 14:29:38 2011 +0100
@@ -2140,8 +2140,8 @@
var ret = this.Super('showInlineEditor', [rowNum, colNum, newCell, newRow,
suppressFocus]);
- delete this._showingEditor;
if (!newRow) {
+ delete this._showingEditor;
return ret;
}
@@ -2183,6 +2183,7 @@
this.view.messageBar.hide();
+ delete this._showingEditor;
return ret;
},
diff -r 736b6c531d88 -r 75d0f48b9623
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
---
a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
Wed Nov 30 14:13:40 2011 +0100
+++
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
Wed Nov 30 14:29:38 2011 +0100
@@ -376,7 +376,18 @@
// disable tab to icons
canTabToIcons: false,
-
+
+ _original_validate: isc.FormItem.getPrototype().validate,
+ validate: function() {
+
+ // prevent validation when we are showing the editor and moving
+ // the focus around
+ if (this.form && this.form.grid && this.form.grid._showingEditor) {
+ return;
+ }
+ return this._original_validate();
+ },
+
_original_init: isc.FormItem.getPrototype().init,
init: function() {
this.obShowIf = this.showIf; // Copy the reference of showIf definition
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits