PDA

View Full Version : How to catch DataStore proxy end of loading ?



ne0vincent
2 Jul 2012, 5:07 AM
Hi,

I'm trying to catch the end of AJAX loading of data.

I've tried some different listeners parameters, but nothing works.



var store_poles = Ext.create('Ext.data.Store', {
fields: ['name'],
proxy: {
type: 'ajax',
url : PolesData,
reader: {
type: 'json',
root: 'Poles'
}
},
autoLoad: true,
listeners: function(param, param2){ alert("test"); }


});

any idea ? :(

Izhaki
2 Jul 2012, 5:26 AM
You can override the `onBatchOperationComplete` method of the store (it is undocumented, but work - look at the source of `Ext.data.AbstractStore`.

sword-it
2 Jul 2012, 6:22 AM
Hi ne0vincet,

Looks like you want to do something after your store load. You can use load event of store, for example ..


listners:{
load: function(store, record, true){
alert('store loaded successfully ');
}
}

for more information see....http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.JsonStore-event-load

ne0vincent
2 Jul 2012, 6:36 AM
Ok.

But : listeners --> load function is not very explicit.

load, also means "is loading" and no "after loading".

Maybe a parameters like "afterloading" could be more understandable ;)

Anyway, thanks !