Ready to Learn?Ex Libris products all provide open APIs

Tech Blog

 

Change the Number of Results Loaded in Primo NUI

Duncan Wilson on November 9th, 2017

The default for the number of results loaded in the Primo NUI is 10 records. To increase this then this code can be used in custom.js.

               

app.component('prmExploreMainAfter',{

bindings: {parentCtrl: '<'},

controller: function($scope){

                              var vm = this;

//adjust these values to control the number of results you want to display

                              vm.parentCtrl.searchService.cheetah.PAGE_SIZE = 50;

                              vm.parentCtrl.itemsPerPage = 50;

                              vm.parentCtrl.PAGE_SIZE = 50;

                              vm.parentCtrl.searchService.cheetah.configurationUtil.searchStateService.resultsBulkSize = 50;

                            

                               vm.parentCtrl.configurationUtil.systemConfiguration["FE UI – Scrolling Threshold"] = 50;   //change according to the number of results loaded




        window.setInterval(function(){

                                   setTimeout(function(){

                               var checkFirstPage = document.body.innerHTML.toString().search('md-subheader _md md-primoExplore-theme');

                                                                           setTimeout(function(){

                               var checkFirstPage = document.body.innerHTML.toString().search('list-item-wrapper first-in-page');

                                          if (checkFirstPage > -1){

                                             var firstDiv = document.getElementsByClassName("list-item-wrapper first-in-page");

                           var arrayLength = firstDiv.length;

                                                            for (var i = 0; i < arrayLength; i++) {

                                                                           document.getElementsByClassName('list-item-wrapper first-in-page')[0].classList.remove('first-in-page');

                                                                            }

                                              }

              }, 500)

                                          if (checkFirstPage > -1){

                                             var firstDiv = document.getElementsByClassName("md-subheader _md md-primoExplore-theme");

                           var arrayLength = firstDiv.length;

                                                            for (var i = 0; i < arrayLength; i++) {

                                     angular.element(firstDiv).remove();

                                                                            }

                                              }

              }, 500)

        }, 500);

                              }

});

//remove the page navigation widget
app.component('prmPageNavMenu',{

bindings: {parentCtrl: '<'},

controller: function($scope){

      setTimeout(function(){

      var removeWidget = angular.element( document.querySelector( '.page-nav-inner' ) );

removeWidge.remove();

                 }, 1000)

  }

});