diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js index 1b8cfc13b104c0c3566511479b700b767479dea5..dbecaeda7d96274cc85cf0a9b426e66da09d2b8c 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/DataGridController.js @@ -26,30 +26,18 @@ function DataGridController(title, columns, data, rowClickEventHandler, showAllC this.init = function($container, extraOptions) { var webAppId = "ELN-LIMS"; - mainController.serverFacade.openbisServer.getWebAppSettings(webAppId, function(response) { - var settings = response.result.settings; + mainController.serverFacade.getSetting(configKey, function(tableConfig) { var onColumnsChange = function(tableState) { - if(!settings) { - settings = {}; - } - settings[configKey] = JSON.stringify(tableState); - - var webAppSettings = { - "@type" : "WebAppSettings", - "webAppId" : webAppId, - "settings" : settings - } - - mainController.serverFacade.openbisServer.setWebAppSettings(webAppSettings, function(result) {}); + mainController.serverFacade.setSetting(configKey, JSON.stringify(tableState)); } - var tableSettings = null; - if(configKey && settings[configKey]) { - tableSettings = JSON.parse(settings[configKey]); - if(Object.keys(tableSettings).length > 3) { //Clean old settings - tableSettings = null; + + if(tableConfig) { + tableConfig = JSON.parse(tableConfig); + if(!tableConfig.pageSize) { //Clean old settings + tableConfig = null; } } - _this._grid = new Grid(columns, data, showAllColumns, tableSettings, onColumnsChange, isMultiselectable); + _this._grid = new Grid(columns, data, showAllColumns, tableConfig, onColumnsChange, isMultiselectable); if(rowClickEventHandler) { _this._grid.addRowClickListener(rowClickEventHandler); } 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 13f118cf9b314a6fcf54659e78b2cedce302fb13..9ff4aa5ede6be80cb66dcf32260901a46315519b 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 @@ -311,9 +311,18 @@ $.extend(Grid.prototype, { exportTSV : function(isAllRowsOrVisible, isAllColumnsOrVisible, plainText) { var _this = this; - if(plainText) { - Util.showWarning("<b>DO NOT USE THIS FILE FOR BATCH UPDATE!</b><br>This file does not contain rich text format. If used for Batch Update, all rich text format in the updated entries will be lost!", function() { + var disablePlanTextExportWarning = this.tableSettings.disablePlanTextExportWarning; + if(plainText && !disablePlanTextExportWarning) { + var dontShowAnymore = "<input type='checkbox' id='disablePlanTextExportWarning'> Don't show this warning again."; + + Util.showWarning("<b>DO NOT USE THIS FILE FOR BATCH UPDATE!</b><br>This file does not contain rich text format. If used for Batch Update, all rich text format in the updated entries will be lost!<br><br>" + dontShowAnymore, function() { _this.exportTSVB(isAllRowsOrVisible, isAllColumnsOrVisible, plainText); + + var isSelected = $("#disablePlanTextExportWarning").val() === "on"; + if(_this.onChangeState) { + _this.tableSettings.disablePlanTextExportWarning = isSelected; + _this.onChangeState(_this.tableSettings); + } }); } else { _this.exportTSVB(isAllRowsOrVisible, isAllColumnsOrVisible, plainText);