diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 6ed44188414c7d894f5233c0ee6f11b961167d67..ee13e2355be2d1cb8ded8dba0a02b5847ea97214 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -265,16 +265,34 @@ function SampleFormView(sampleFormController, sampleFormModel) { } if(this._sampleFormModel.mode !== FormMode.CREATE && this._sampleFormModel.paginationInfo) { + var moveToIndex = function(index) { + var pagOptionsToSend = $.extend(true, {}, _this._sampleFormModel.paginationInfo.pagOptions); + pagOptionsToSend.pageIndex = index; + pagOptionsToSend.pageSize = 1; + _this._sampleFormModel.paginationInfo.pagFunction(function(result) { + if(result && result.objects && result.objects[0] && result.objects[0].permId) { + _this._sampleFormModel.paginationInfo.currentIndex = index; + var arg = { + permIdOrIdentifier : result.objects[0].permId, + paginationInfo : _this._sampleFormModel.paginationInfo + } + mainController.changeView('showViewSamplePageFromPermId', arg); + } else { + window.alert("The item to go to is no longer available."); + } + }, pagOptionsToSend); + } + if(this._sampleFormModel.paginationInfo.currentIndex > 0) { var $backBtn = FormUtil.getButtonWithIcon("glyphicon-arrow-left", function () { - + moveToIndex(_this._sampleFormModel.paginationInfo.currentIndex-1); }); toolbarModel.push({ component : $backBtn, tooltip: "Go to previous Object from list" }); } if(this._sampleFormModel.paginationInfo.currentIndex+1 < this._sampleFormModel.paginationInfo.totalCount) { var $nextBtn = FormUtil.getButtonWithIcon("glyphicon-arrow-right", function () { - + moveToIndex(_this._sampleFormModel.paginationInfo.currentIndex+1); }); toolbarModel.push({ component : $nextBtn, tooltip: "Go to next Object from list" }); }