diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index 5d6566e72109e2dc66b5703a2ee0013d8e139a52..dc741d9fa6d5ce4bbeca1e0a1ae26be985386fbf 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -509,26 +509,34 @@ function MainController(profile) { break; case "showViewSamplePageFromPermId": var _this = this; - this.serverFacade.searchWithUniqueId(arg, function(data) { + var permId = null; + if((typeof arg) !== "string") { + permId = arg.permIdOrIdentifier; + } + this.serverFacade.searchWithUniqueId(permId, function(data) { if(!data[0]) { window.alert("The item is no longer available, refresh the page, if the problem persists tell your admin that the Lucene index is probably corrupted."); } else { document.title = "" + ELNDictionary.Sample + " " + data[0].code; var isELNSubExperiment = $.inArray(data[0].spaceCode, _this.profile.inventorySpaces) === -1&& _this.profile.inventorySpaces.length > 0; - _this._showViewSamplePage(data[0], isELNSubExperiment); + _this._showViewSamplePage(data[0], isELNSubExperiment, arg.paginationInfo); //window.scrollTo(0,0); } }); break; case "showViewSamplePageFromIdentifier": var _this = this; - this.serverFacade.searchWithIdentifiers([arg], function(data) { + var identifier = null; + if((typeof arg) !== "string") { + identifier = arg.permIdOrIdentifier; + } + this.serverFacade.searchWithIdentifiers([identifier], function(data) { if(!data[0]) { window.alert("The item is no longer available, refresh the page, if the problem persists tell your admin that the Lucene index is probably corrupted."); } else { document.title = "" + ELNDictionary.Sample + " " + data[0].code; var isELNSubExperiment = $.inArray(data[0].spaceCode, _this.profile.inventorySpaces) === -1&& _this.profile.inventorySpaces.length > 0; - _this._showViewSamplePage(data[0], isELNSubExperiment); + _this._showViewSamplePage(data[0], isELNSubExperiment, arg.paginationInfo); //window.scrollTo(0,0); } }); @@ -898,7 +906,7 @@ function MainController(profile) { trashcanController.init(views); } - this._showViewSamplePage = function(sample, isELNSubExperiment) { + this._showViewSamplePage = function(sample, isELNSubExperiment, paginationInfo) { //Show Form var sampleFormController = new SampleFormController(this, FormMode.VIEW, sample); this.currentView = sampleFormController; diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js index a2078518473bdaddab7e4a2f095d5c620dd4ea52..f44e5b5fd9759ed422b0b0b37d8bb3f03271149e 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js @@ -881,7 +881,7 @@ var FormUtil = new function() { return $dropDownMenu; } - this.getFormLink = function(displayName, entityKind, permIdOrIdentifier) { + this.getFormLink = function(displayName, entityKind, permIdOrIdentifier, paginationInfo) { var view = null; switch(entityKind) { case "Space": @@ -907,7 +907,16 @@ var FormUtil = new function() { var href = Util.getURLFor(mainController.sideMenu.getCurrentNodeId(), view, permIdOrIdentifier); var click = function() { - mainController.changeView(view, permIdOrIdentifier, true); + var arg = null; + if(paginationInfo) { + arg = { + permIdOrIdentifier : permIdOrIdentifier, + paginationInfo : paginationInfo + } + } else { + arg = permIdOrIdentifier; + } + mainController.changeView(view, arg, true); } displayName = String(displayName).replace(/<(?:.|\n)*?>/gm, ''); //Clean any HTML tags var link = $("<a>", { "href" : href, "class" : "browser-compatible-javascript-link" }).text(displayName); 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 00fb687eefa60c9b92250a9528e179c78e9fe848..3b74c35f0a493f5c289940f418f444dd51e7df8c 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 @@ -1,5 +1,7 @@ var SampleDataGridUtil = new function() { this.getSampleDataGrid = function(mandatoryConfigPostKey, samplesOrCriteria, rowClick, customOperations, customColumns, optionalConfigPostKey, isOperationsDisabled, isLinksDisabled, isMultiselectable, withExperiment) { + var _this = this; + var isDynamic = samplesOrCriteria.entityKind && samplesOrCriteria.rules; //Fill Columns model var columnsFirst = []; @@ -9,8 +11,15 @@ var SampleDataGridUtil = new function() { property : 'identifier', isExportable: true, sortable : true, - render : function(data) { - return (isLinksDisabled)?data.identifier:FormUtil.getFormLink(data.identifier, "Sample", data.permId); + render : function(data, grid) { + var paginationInfo = null; + if(isDynamic) { + paginationInfo = { + pagFunction : _this.getDataListDynamic(samplesOrCriteria, false), + pagOptions : grid.lastUsedOptions + } + } + return (isLinksDisabled)?data.identifier:FormUtil.getFormLink(data.identifier, "Sample", data.permId, paginationInfo); }, filter : function(data, filter) { return data.identifier.toLowerCase().indexOf(filter) !== -1; @@ -243,7 +252,7 @@ var SampleDataGridUtil = new function() { //Fill data model var getDataList = null; - if(samplesOrCriteria.entityKind && samplesOrCriteria.rules) { + if(isDynamic) { getDataList = SampleDataGridUtil.getDataListDynamic(samplesOrCriteria, withExperiment); //Load on demand model } else { getDataList = SampleDataGridUtil.getDataList(samplesOrCriteria); //Static model 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 f08184bb8abdfcffaa80502828aee2e04c1e89a6..be184f40b44a86dcd76a216086c33c6ac6f34182 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 @@ -573,7 +573,7 @@ $.extend(Grid.prototype, { //1. Render var value = null; if (column.render) { - value = column.render(data); + value = column.render(data, thisGrid); } else { value = data[column.property]; } @@ -608,6 +608,7 @@ $.extend(Grid.prototype, { list : function(options, callback) { options.searchOperator = this.getSearchOperator(); var thisGrid = this; + thisGrid.lastUsedOptions = options; if(thisGrid.firstLoad) { $(thisGrid.panel).hide();