Set form height to 100%, changed initial empty data message of grid to loading
authorMartin Taal <martin.taal@openbravo.com>
Tue, 25 Jan 2011 23:49:38 +0100
changeset 10129 b9c4daa3bff7
parent 10128 67117d6c25f3
child 10130 1b9e9f910f8c
Set form height to 100%, changed initial empty data message of grid to loading
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
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-form.js	Tue Jan 25 23:48:58 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js	Tue Jan 25 23:49:38 2011 +0100
@@ -34,6 +34,8 @@
   sessionAttributes: {},
   dynamicCols: [],
   width: '100%',
+  height: '100%',
+  
   
   showErrorIcons: false,
   showErrorStyle: true,
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js	Tue Jan 25 23:48:58 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js	Tue Jan 25 23:49:38 2011 +0100
@@ -79,6 +79,7 @@
   autoFitWidthApproach: 'title',
   canAutoFitFields: false,
   width: '100%',
+  height: '100%',
   
   autoFetchTextMatchStyle: 'substring',
   showFilterEditor: true,
@@ -109,7 +110,7 @@
   
   canMultiSort: false,
   
-  emptyMessage: OB.I18N.getLabel('OBUIAPP_NoDataInGrid'),
+  emptyMessage: OB.I18N.getLabel('OBUISC_ListGrid.loadingDataMessage'),
   discardEditsSaveButtonTitle: OB.I18N.getLabel('UINAVBA_Save'),
   
   quickDrawAheadRatio: 6.0,
@@ -220,7 +221,7 @@
     
     var ret = this.Super('initWidget', arguments);
     
-    this.noDataEmptyMessage = OB.I18N.getLabel('OBUIAPP_GridNoRecords') + ' <span onclick="window[\'' + this.ID + '\'].createNew();" class="OBLabelLink">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne')+ '</span>';
+    this.noDataEmptyMessage = OB.I18N.getLabel('OBUISC_ListGrid.loadingDataMessage'); //OB.I18N.getLabel('OBUIAPP_GridNoRecords') + ' <span onclick="window[\'' + this.ID + '\'].createNew();" class="OBLabelLink">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne')+ '</span>';
     this.filterNoRecordsEmptyMessage = OB.I18N.getLabel('OBUIAPP_GridFilterNoResults') + ' <span onclick="window[\'' + this.ID + '\'].clearFilter();" class="OBLabelLink">' + OB.I18N.getLabel('OBUIAPP_GridClearFilter')+ '</span>';    
     return ret;
   },
@@ -249,12 +250,6 @@
   
   setView: function(view) {
     this.view = view;
-    if (view.readOnly) {
-      this.noDataEmptyMessage = OB.I18N.getLabel('OBUIAPP_NoDataInGrid');
-    } else {
-      this.noDataEmptyMessage = OB.I18N.getLabel('OBUIAPP_GridNoRecords') + ' <span onclick="window[\'' + this.ID + '\'].createNew();" class="OBLabelLink">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne')+ '</span>';
-    }
-    this.resetEmptyMessage();    
   },
   
   show: function(){
@@ -347,6 +342,14 @@
   //   mode is opened
   // - if there is only one record then select it directly
   dataArrived: function(startRow, endRow){
+    // do this now, to replace the loading message
+    if (this.view.readOnly) {
+      this.noDataEmptyMessage = OB.I18N.getLabel('OBUIAPP_NoDataInGrid');
+    } else {
+      this.noDataEmptyMessage = OB.I18N.getLabel('OBUIAPP_GridNoRecords') + ' <span onclick="window[\'' + this.ID + '\'].createNew();" class="OBLabelLink">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne')+ '</span>';
+    }
+    this.resetEmptyMessage();    
+    
     var record, ret = this.Super('dataArrived', arguments);
     this.updateRowCountDisplay();
     if (this.getSelectedRecords().length > 0) {