jquery - Pagination is not working in IE 11 while using select2 query function -


i've used below code cache select2 data. each call i'll 50 record server .if ajax request contains more 50 record count ,i've appended morerows equal true server.i'll cache result if request has less 50 records else request made server . i've cached data in select2 jquery element.if response contains more 1 page , next ajax made , result ll append previous (this done select2 query more option).i've facing following issue.if scroll list of items down , try select 1 mouse second page, list instantly refreshes first page , selection made mouse cursor position on 1st page. if item on scrolled down list highlighted hovering mouse on list , selected keyboard behave ok. erratic mouse behaviour not appear happen in latest chrome browser , item in scrolled down list can selected mouse click.it occurs in ie 11 . in ie 10,ie 9 ,ie edge working fine .

jquery("#componentid").select2({      minimuminputlength: 0,     multiple:false,     placeholder:key,      searchinputplaceholder:key,     query: function(query1) {          self = this;         var key = query1.term;         var term=key;          var havingcacheddata=false;         var cacheddata;         var cachedatasource=jquery('#componentid').data("cachedatasource");//no i18n         if(cachedatasource){             jquery.each(cachedatasource, function(cachekey, storeddata){                 if ((cachekey != '' && (term.indexof(cachekey) == 0 || term == cachekey))||(cachekey == '' && term == cachekey)) {                      havingcacheddata = true;                     var toret={more:false,results:[]};                      jquery.each(storeddata,function(key,item){                         if(item.text.tolowercase().indexof(term.tolowercase()) > -1){                             toret.results.push({id:item.id,text:item.text,row:item});                            }                     });                      cacheddata=toret.results;                 }             })          }         var page=query1.page;         if(havingcacheddata) {             query1.callback({results: cacheddata});             return;         } else {              $.ajax({url: "myurl", success: function(result){     jquery.each(result.product,function(key,item){                     var name=item.name;                     var toret={more:false,results:[],context:data.list_info};                 toret.more = result.list_info.has_more_rows;                 toret.results.push({id:item.id,text:name,row:item});                 });                 if(toret.more == false && data.list_info.start_index <= 1 )                 {                     var data=jquery('#componentid').data("cachedatasource");//no i18n                      if(!data){                         data={};                     }                     data[term] = toret.results;                     jquery('#componentid').data('cachedatasource',data);//no i18n                   }                  query1.callback({results: toret.results,more:toret.more}); }});            }      }   });  


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -