Reputation: 619
I have been working with ExtJS 6.0 . I use Ajax Request to retrieve data from application server. In my current view onClick of OK button, am making Ajax call by passing payload to the service. At the same time am masking the screen with cancel button on it. Sometime service takes time to respond. user may thinks to redefine his search by clicking cancel button and do the action again. I used to unmask the screen when click of cancel in masking screen but Ajax is not getting aborted. it loads the old data as soon as service respond. is ther any way to stop/abort my old ajax request?
Upvotes: 3
Views: 2935
Reputation: 420
Try this
var requestId = Ext.Ajax.request({...});
Ext.Ajax.abort(requestId);
Upvotes: 4