Extjs combo as autocomplete search box, synchronization
I have a problem which I use as autocomplete search. The issue is that when I write something, and I make mistake then delete last开发者_C百科 char, There are two requests. Sometimes the second request comes back first and the store loads results and then the first request comes back and store is populated with that result set. So I end in a situation where I have word_two in searchbox, and results for word_one.
Is there a way to tell store to abort previous request when new one is fired? Or at least tell the store to wait for the request to come back before starting new one?
Ok. I've done it like this and it works. I added proxy to store:
proxy: new Ext.data.HttpProxy({
url: 'some_url',
listeners:{
beforeload:{
scope:this,
fn:function(dp, params){
if(dp.activeRequest['read']){
dp.activeRequest['read'].conn.abort();
}
}
}
},
精彩评论