From 7bd7fa95c702874627bcba40d151b18dadf4120d Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Tue, 10 Jan 2017 10:44:13 +0000
Subject: [PATCH] SSDM-4552 : Extra changes to sample tables loading to make
 them feel faster

SVN: 37573
---
 .../html/js/views/DataGrid/SampleDataGridUtil.js         | 1 +
 .../html/js/views/SampleTable/SampleTableController.js   | 2 +-
 .../1/as/webapps/eln-lims/html/lib/grid/js/Grid.js       | 9 ++++++++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
index 27459254beb..52682e37221 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/SampleDataGridUtil.js
@@ -287,6 +287,7 @@ var SampleDataGridUtil = new function() {
 					objects : dataList,
 					totalCount : result.totalCount
 				});
+				Util.unblockUI();
 			}
 			
 			var fetchOptions = {
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableController.js
index e45bd922413..c2c37055071 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableController.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/SampleTableController.js
@@ -25,7 +25,7 @@ function SampleTableController(parentController, title, experimentIdentifier, pr
 		
 		var callback = function() {
 			_this._sampleTableView.repaint($container);
-			Util.unblockUI();
+			//Util.unblockUI();
 		};
 		
 		if(this._sampleTableModel.experimentIdentifier || projectPermId) {
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js
index 320636db652..093996651b0 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/lib/grid/js/Grid.js
@@ -11,6 +11,8 @@ $.extend(Grid.prototype, {
 		this.getDataList = getDataList;
 		this.showAllColumns = showAllColumns;
 		this.tableSettings = tableSettings;
+		this.firstLoad = true;
+		
 		if(!this.tableSettings) {
 			this.tableSettings = {
 					columns : null,
@@ -566,6 +568,11 @@ $.extend(Grid.prototype, {
 	list : function(options, callback) {
 		var thisGrid = this;
 		
+		if(thisGrid.firstLoad) {
+			$(thisGrid.panel).hide();
+			thisGrid.firstLoad = false;
+		}
+		
 		thisGrid.getDataList(function(dataListResult) {
 			dataList = null;
 			var isDynamic = (dataListResult.totalCount != null && dataListResult.totalCount != undefined);
@@ -676,7 +683,7 @@ $.extend(Grid.prototype, {
 				
 				//HACK:	Legacy Hacks no longer needed
 				$(window).trigger('resize'); // HACK: Fixes table rendering issues when refreshing the grid on fuelux 3.1.0 for all browsers
-				$(thisGrid.panel).hide().show(0); // HACK: Fixes Chrome rendering issues when refreshing the grid on fuelux 3.1.0
+				$(thisGrid.panel).show(0); // HACK: Fixes Chrome rendering issues when refreshing the grid on fuelux 3.1.0
 				
 				// HACK: Fix that only works if there is only one table at a time (dont works Safari)
 //				var newWidth = $(".repeater-list-wrapper > .table").width();
-- 
GitLab