Setting Search Response Delay Time…

  1. XML Code Snippet:

  <subHeader>
   <Toolbar id=”searchResultToolbar”>
     <SearchField id=”mySearchField” liveChange=”onLiveSearch” showRefreshButton=”{device>/isNoTouch}” placeholder=”{i18n>SEARCH_ACCOUNTS}”/>
     <Button id=”personalizationButton”
       icon=”sap-icon://action-settings”
       visible=”{path:’/’, formatter:’.isInConfigurationMode’}”
       press=”onPersonalizationButtonPressed”
       size=”1.2rem”
       tooltip=”{i18n>PERSONALIZE_COLUMNS_TOOLTIP}”/>
   </Toolbar>
  </subHeader>

 

JS Code Snippet:

 // ##################################################################
  // Search
 // ##################################################################

 onLiveSearch: function(oEvent) {
  var delay = 300;
  var searchString = oEvent.getParameter(“newValue”);
  var that = this;
  window.clearTimeout(this.liveChangeTimer);
  this.liveChangeTimer = window.setTimeout(function() {
   that._applyFilter(null, searchString);
  }, delay);
 },

Leave a Comment