details:   https://code.openbravo.com/erp/devel/pi/rev/f497677fd0d9
changeset: 21067:f497677fd0d9
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Wed Sep 04 10:14:05 2013 +0200
summary:   fixed bug 24684: Double DataSource request when there is grid 
configuration

  viewState (grid configuration) is set when building view structure so it is
  used in first DS request preventing in this way second one and displaying
  directly the customized grid without need of redrawing it.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
   |  11 +++++++++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
 |  12 +++++----
 2 files changed, 18 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 5375dedb29d6 -r f497677fd0d9 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Wed Sep 04 01:56:32 2013 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Wed Sep 04 10:14:05 2013 +0200
@@ -292,6 +292,17 @@
     }
     this.dataSource.view = this;
 
+    // In case of grid configuration, apply it now. In this way:
+    //   -No extra fetch is done for root tab
+    //   -Grid is not rendered twice (one for the standard confing and another
+    //    one for the saved config)
+    if (this.standardWindow && this.standardWindow.viewState && 
this.standardWindow.viewState[this.tabId]) {
+      this.viewGrid.setViewState(this.standardWindow.viewState[this.tabId]);
+      // lastViewApplied is set because there are modifications in grid, so not
+      // marking "Standard View" in view's menu
+      this.standardWindow.lastViewApplied = true;
+    }
+
     // directTabInfo is set when we are in direct link mode, i.e. directly 
opening
     // a specific tab with a record, the direct link logic will already take 
care
     // of fetching data
diff -r 5375dedb29d6 -r f497677fd0d9 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Wed Sep 04 01:56:32 2013 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
       Wed Sep 04 10:14:05 2013 +0200
@@ -94,7 +94,13 @@
     if (this.command === isc.OBStandardWindow.COMMAND_NEW) {
       this.viewProperties.allowDefaultEditMode = false;
     }
-    this.viewState = OB.PropertyStore.get('OBUIAPP_GridConfiguration', 
this.windowId);
+
+    if (OB.Utilities.checkProfessionalLicense(null, true)) {
+      this.viewState = OB.PropertyStore.get('OBUIAPP_GridConfiguration', 
this.windowId);
+    } else {
+      this.viewState = null;
+    }
+
     this.allowDelete = OB.PropertyStore.get("AllowDelete", this.windowId);
     this.allowAttachment = OB.PropertyStore.get("AllowAttachment", 
this.windowId);
     this.view = isc.OBStandardView.create(this.viewProperties);
@@ -544,10 +550,6 @@
               this.lastViewApplied = true;
               
OB.Personalization.personalizeForm(personalization.forms[this.views[i].tabId], 
this.views[i].viewForm);
             }
-            if (this.viewState && this.viewState[this.views[i].tabId]) {
-              this.lastViewApplied = true;
-              
this.views[i].viewGrid.setViewState(this.viewState[this.views[i].tabId]);
-            }
           }
         }
       }

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to