PDA

View Full Version : How can i stop a batch of proxies requsting to server?



korndeang
8 Jul 2013, 5:43 PM
I have a problem with batch of proxies request to server any time how can i stop/cancel?
I have a block of code that need to execute a mount of stores, but if match any condition i still want execute that block of code just want disable or cancel all stores.

Farish
9 Jul 2013, 12:11 AM
I am not sure if I understand your question clearly. I think you want to cancel sending a request to your backend and reject the changes in the store. For this, the rejectChanges (http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Store-method-rejectChanges) method of the store might help you. If you want to prevent the store from automatically syncing with the backend on every change, then you should set autoSync (http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Store-cfg-autoSync) to false for the store.

korndeang
9 Jul 2013, 12:54 AM
I mean i want abort ajax on proxies.
every request to server i have tracking on my app.js like this:


...
appFolder: './js/Ext/app',
init: function () {
var me = this;
CRM.app = me;
Ext.data.StoreManager.on('add', function (i, store) {
store.on('beforeLoad',function(st, operation){

//In here every store before load will be execute this block, so i want cancel/abort any time
//After search many hours some people suggest use Ext.Ajax.abort(requestId) but i am no luck :s


});
store.on('load', function (st) {
...