diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/DataGrid/DataGridController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/DataGrid/DataGridController.js index 5812fa9c7cace45fcf0cd4190cbfd778f27fc3d7..1a4b92752a10c958b9bf2d31490a827e269fb0bb 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/DataGrid/DataGridController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/DataGrid/DataGridController.js @@ -14,7 +14,7 @@ * limitations under the License. */ -function DataGridController(title, columns, data, rowClickEventHandler, showAllColumns) { +function DataGridController(title, columns, data, rowClickEventHandler, showAllColumns,configKey) { this._grid = null; this._dataGridModel = null; this._dataGridView = null; @@ -25,11 +25,10 @@ function DataGridController(title, columns, data, rowClickEventHandler, showAllC mainController.serverFacade.openbisServer.getWebAppSettings(webAppId, function(response) { var settings = response.result.settings; var onColumnsChange = function(columnsModel) { - console.log("SAVING START"); if(!settings) { settings = {}; } - settings[_this._dataGridModel.title] = JSON.stringify(columnsModel); + settings[configKey] = JSON.stringify(columnsModel); var webAppSettings = { "@type" : "WebAppSettings", @@ -37,13 +36,11 @@ function DataGridController(title, columns, data, rowClickEventHandler, showAllC "settings" : settings } - console.log("SAVING: " + JSON.stringify(settings)); mainController.serverFacade.openbisServer.setWebAppSettings(webAppSettings, function(result) {}); } - console.log("LOAD: " + JSON.stringify(settings)); var tableSettings = null; - if(settings[title]) { - tableSettings = JSON.parse(settings[title]); + if(settings[configKey]) { + tableSettings = JSON.parse(settings[configKey]); } _this._grid = new Grid(columns, data, showAllColumns, tableSettings, onColumnsChange); _this._grid.addRowClickListener(rowClickEventHandler); diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/StorageListView.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/StorageListView.js index bd046f0d018f242275f43debcf0ad2b3b883e360..203b8c068fef562fa22be393162401eb11c772fe 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/StorageListView.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/widgets/StorageListView.js @@ -92,7 +92,7 @@ function StorageListView(storageListController, storageListModel) { } } - this._dataGrid = new DataGridController(null, columns, getDataList, rowClick); + this._dataGrid = new DataGridController(null, columns, getDataList, rowClick, false, "STORAGE_WIDGET"); var $dataGridContainer = $("<div>"); this._dataGrid.init($dataGridContainer); diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js index 049ee5c6550f8335eec87951017d60466d80cc88..a0a5f98a0130e51b44ac57c6926207047fbf0c24 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleTable/SampleTableController.js @@ -222,7 +222,8 @@ function SampleTableController(parentController, title, experimentIdentifier) { } //Create and display table - var dataGridController = new DataGridController(null, columns, getDataList, rowClick); + var configKey = "SAMPLE_"+ sampleType.code; + var dataGridController = new DataGridController(configKey, columns, getDataList, rowClick, false, configKey); dataGridController.init(this._sampleTableView.getTableContainer()); } } diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/legacy/SampleLinksWidget.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/legacy/SampleLinksWidget.js index 836d1a7c01c357e1b8ce18c5f93b460409155f5c..e3522aab07015a565469a454cf27a8795036e416 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/legacy/SampleLinksWidget.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/legacy/SampleLinksWidget.js @@ -306,7 +306,8 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType callback(dataList); }; - var dataGrid = new DataGridController(null, columns, getDataList, rowClick); + var configKey = "SAMPLE_" + sampleTypeCode; + var dataGrid = new DataGridController(null, columns, getDataList, rowClick, false, configKey); dataGrid.init($("#" + tableId)); //Store new state