details:   /erp/devel/pi/rev/9bbe067ee20c
changeset: 10859:9bbe067ee20c
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Feb 24 09:31:30 2011 +0100
summary:   Make it possible to edit errors in the row inside the form

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
 |  7 +++++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  5 +++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r a8b48b4236a4 -r 9bbe067ee20c 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Thu Feb 24 09:14:26 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Thu Feb 24 09:31:30 2011 +0100
@@ -749,10 +749,13 @@
 
         // do this after doing autoSave as the setHasChanged will clean
         // the autosave info
-        this.setHasChanged(false);
+        form.setHasChanged(false);
+        
+        // remove any edit info in the grid
+        view.viewGrid.discardEdits(recordIndex, null, false, 
isc.ListGrid.PROGRAMMATIC, true);
         
         // change some labels
-        this.setNewState(false);
+        form.setNewState(false);
         
         view.refreshParentRecord();
       } else if (status === isc.RPCResponse.STATUS_VALIDATION_ERROR && 
resp.errors) {
diff -r a8b48b4236a4 -r 9bbe067ee20c 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Thu Feb 24 09:14:26 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Thu Feb 24 09:31:30 2011 +0100
@@ -1161,11 +1161,12 @@
     this.view.toolBar.updateButtonState(true);
   },
   
-  discardEdits: function(rowNum, colNum, dontHideEditor, editCompletionEvent){
+  discardEdits: function(rowNum, colNum, dontHideEditor, editCompletionEvent, 
preventConfirm){
     var localArguments = arguments;
     var me = this, record = this.getRecord(rowNum);
     
-    if (record._new || this.getEditForm().valuesHaveChanged() || 
this.rowHasErrors(rowNum)) {
+    if (!preventConfirm && 
+    (record._new || this.getEditForm().valuesHaveChanged() || 
this.rowHasErrors(rowNum))) {
       isc.ask(OB.I18N.getLabel('OBUIAPP_ConfirmCancelEdit'), function(value){
         if (value) {
         

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to