details:   https://code.openbravo.com/erp/devel/pi/rev/08694941dab4
changeset: 21245:08694941dab4
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Tue Oct 08 23:47:04 2013 +0200
summary:   Fixed issue 24914: Added statements to avoid JS errors
while trying to prepare a simplification of OBViewGrid (based in ListGrid) to 
debug

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
                |  15 ++++-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
 |  32 +++++----
 2 files changed, 32 insertions(+), 15 deletions(-)

diffs (82 lines):

diff -r 9c0d7420d284 -r 08694941dab4 
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
     Tue Oct 08 19:14:12 2013 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
     Tue Oct 08 23:47:04 2013 +0200
@@ -292,6 +292,19 @@
     }
   },
 
+  // To avoid JS error if OBViewGrid doesn't extend OBGrid (for debugging 
purposes)
+  isGridFiltered: function () {
+    return this.Super('isGridFiltered', arguments);
+  },
+  // To avoid JS error if OBViewGrid doesn't extend OBGrid (for debugging 
purposes)
+  checkShowFilterFunnelIcon: function () {
+    return this.Super('checkShowFilterFunnelIcon', arguments);
+  },
+  // To avoid JS error if OBViewGrid doesn't extend OBGrid (for debugging 
purposes)
+  focusInFirstFilterEditor: function () {
+    return this.Super('focusInFirstFilterEditor', arguments);
+  },
+
   initWidget: function () {
     var i, vwState;
 
@@ -1766,7 +1779,7 @@
 
     newCallBack = function () {
       theView.recordSelected();
-      if (callback) {
+      if (typeof callback === 'function') {
         callback();
       }
     };
diff -r 9c0d7420d284 -r 08694941dab4 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
      Tue Oct 08 19:14:12 2013 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
      Tue Oct 08 23:47:04 2013 +0200
@@ -44,16 +44,18 @@
     }
 
     // Always show progress in save button and disable save and close one
-    btn = this.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_SAVE);
-    btn.setDisabled(true);
-    btn.customState = 'Progress';
-    btn.resetBaseStyle();
-    btn.markForRedraw();
+    if (this.view.toolBar) {
+      btn = this.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_SAVE);
+      btn.setDisabled(true);
+      btn.customState = 'Progress';
+      btn.resetBaseStyle();
+      btn.markForRedraw();
 
-    btn2 = this.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_SAVECLOSE);
-    if (btn2) {
-      btn2.setDisabled(true);
-      btn2.markForRedraw();
+      btn2 = this.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_SAVECLOSE);
+      if (btn2) {
+        btn2.setDisabled(true);
+        btn2.markForRedraw();
+      }
     }
   },
 
@@ -64,11 +66,13 @@
       editedRecord.editColumnLayout.toggleProgressIcon(false);
     }
 
-    // always remove the progress style here anyway
-    btn = this.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_SAVE);
-    btn.customState = '';
-    btn.resetBaseStyle();
-    btn.markForRedraw();
+    if (this.view.toolBar) {
+      // always remove the progress style here anyway
+      btn = this.view.toolBar.getLeftMember(isc.OBToolbar.TYPE_SAVE);
+      btn.customState = '';
+      btn.resetBaseStyle();
+      btn.markForRedraw();
+    }
   },
 
   performDSOperation: function (operationType, data, callback, 
requestProperties) {

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to