Skip to content
Snippets Groups Projects
Commit 14ad2fc9 authored by juanf's avatar juanf
Browse files

SSDM-1338: PAPER - PETER MIGRATION - Storage Improvements (Storage Widget from list)

SVN: 33200
parent 70c20766
No related branches found
No related tags found
No related merge requests found
......@@ -14,8 +14,8 @@
* limitations under the License.
*/
function StorageListController(sample, isEnabled) {
this._storageListModel = new StorageListModel(sample, isEnabled);
function StorageListController(sample, isDisabled) {
this._storageListModel = new StorageListModel(sample, isDisabled);
this._storageListView = new StorageListView(this, this._storageListModel);
this.init = function($container) {
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
function StorageListModel(sample, isEnabled) {
function StorageListModel(sample, isDisabled) {
this.sample = sample;
this.isEnabled = isEnabled;
this.isDisabled = isDisabled;
}
\ No newline at end of file
......@@ -79,7 +79,45 @@ function StorageListView(storageListController, storageListModel) {
callback(dataList);
}
var dataGrid = new DataGridController(null, columns, getDataList, null);
var rowClick = null;
if(!this._storageListModel.isDisabled) {
rowClick = function(e) {
_this.showStorageWidget(e)
}
}
var dataGrid = new DataGridController(null, columns, getDataList, rowClick);
dataGrid.init($container);
}
this.showStorageWidget = function(e) {
var css = {
'text-align' : 'left',
'top' : '15%',
'width' : '70%',
'left' : '15%',
'right' : '20%',
'overflow' : 'auto'
};
var container = "<div class='col-md-12 form-horizontal' id='storage-pop-up-container'></div><br><a class='btn btn-default' id='storage-close'>Close</a>"
Util.blockUI(container, css);
$("#storage-close").on("click", function(event) {
Util.unblockUI();
});
var storageController = new StorageController({
title : e.data.groupDisplayName,
storagePropertyGroupSelector : "off",
storageSelector : "on",
userSelector : "off",
boxSelector: "on",
rackSelector: "on",
contentsSelector: "off",
positionSelector: "on"
});
storageController.getModel().storagePropertyGroup = profile.getStoragePropertyGroup(e.data.groupDisplayName);
storageController.bindSample(this._storageListModel.sample, this._storageListModel.isDisabled);
storageController.getView().repaint($("#storage-pop-up-container"));
}
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ function StorageView(storageController, storageModel, gridView) {
// Paint View
//
var _this = this;
$container.empty();
//$container.empty(); To allow display into a pop-up
if( this._storageModel.config.title) { //It can be null
$container.append("<h2>" + this._storageModel.config.title + "</h2>");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment