From a913ca2f7601dd6f3d7546b8d9617e4d5b8200ac Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Fri, 29 May 2015 13:53:29 +0000
Subject: [PATCH] SSDM-1797 : Storage (ongoing work)

SVN: 34057
---
 .../js/views/StorageManager/widgets/StorageView.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/StorageView.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/StorageView.js
index 388a6bc6b1d..83ba255cb5f 100644
--- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/StorageView.js
+++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/StorageView.js
@@ -203,6 +203,14 @@ function StorageView(storageController, storageModel, gridView) {
 	
 	this.refreshGrid = function() {
 		this._gridView.repaint(this._gridContainer);
+		
+		if(this._storageModel.sample && 
+				this._storageModel.sample.properties[this._storageModel.storagePropertyGroup.rowProperty] &&
+				this._storageModel.sample.properties[this._storageModel.storagePropertyGroup.columnProperty]) {
+			this._storageController._gridController.selectPosition(
+					this._storageModel.sample.properties[this._storageModel.storagePropertyGroup.rowProperty],
+					this._storageModel.sample.properties[this._storageModel.storagePropertyGroup.columnProperty]);
+		}
 	}
 	
 	this.hideBoxSizeField = function() {
@@ -277,7 +285,11 @@ function StorageView(storageController, storageModel, gridView) {
 					_this._storageModel.sample.properties[_this._storageModel.storagePropertyGroup.positionProperty] = null;
 					_this._storageModel.boxPosition = null;
 				} else {
-					_this._storageModel.boxPosition = _this._storageModel.sample.properties[_this._storageModel.storagePropertyGroup.positionProperty];
+					if(_this._storageModel.sample.properties[_this._storageModel.storagePropertyGroup.positionProperty]) {
+						_this._storageModel.boxPosition = _this._storageModel.sample.properties[_this._storageModel.storagePropertyGroup.positionProperty];
+						var xyPos = Util.getXYfromLetterNumberCombination(_this._storageModel.boxPosition);
+						_this._storageController._gridControllerPosition.selectPosition(xyPos[0], xyPos[1]);
+					}
 				}
 			});
 		}
-- 
GitLab