Tech Blog

PrimoVE Item Locations Filter

We recently switched from Primo to PrimoVE and have had numerous complaints about activating the Filter Options for item locations in the Full Display view.

Here is the code I wrote to auto-enable the filter so that it will be on for users when they do a search. Here is a sample picture showing the filter on:

Here is the code:

//Auto activates the filter for items in full display
//written on 2/4/20 by Joe Ferguson from the University of Tennessee, Knoxville
 	app.component('prmLocationItemsAfter', {
  bindings: {parentCtrl: '<'},
  controller: function($scope){
    var myVar = setInterval(activateFilter, 500);

    function activateFilter() {
      if( $("span:contains('Filters')").length ){
        clearInterval(myVar);
        return;
      }

      if( $("[id^='filter']").length ){
        $("[id^='filter']").parent().click()
      }
    }
  }
 	});

Leave a Reply