PDA

View Full Version : totalcountchange event not work with ext mvc



leon.wood
18 Aug 2013, 8:30 PM
I Create a store like this:
Ext.define('App.store.task.STask', {
extend : 'Ext.data.Store',
//more other code....
listeners :{
totalcountchange :function(){
console.info('1111');
}
}
});


look the code, totalcountchange not work,and i can't find this event on extjs4 api?i tried many times,but not work.

tobiu
18 Aug 2013, 11:35 PM
I recommend not to use internal framework events since when they are not listed inside the API docs they could be supposed to be private.

totalcountchange gets fired in 2 spots inside Store.js:
onProxyPrefetch
cachePage

So I think it is intended to internally get used for buffering.

For your use case: you can listen to the load event and call myStore.getTotalCount(). save the value somewhere and you can check if it got different.

leon.wood
19 Aug 2013, 6:19 AM
but in "infinite-scroll-with-filter.js",this demo use it.

leon.wood
20 Aug 2013, 4:08 AM
I recommend not to use internal framework events since when they are not listed inside the API docs they could be supposed to be private.

totalcountchange gets fired in 2 spots inside Store.js:
onProxyPrefetch
cachePage

So I think it is intended to internally get used for buffering.

For your use case: you can listen to the load event and call myStore.getTotalCount(). save the value somewhere and you can check if it got different.
but in "infinite-scroll-with-filter.js",this demo use it.