Pages

Rabu, 29 Agustus 2012

Ext.ux.data.PagingStore problem with empty store

I'm using Ext.ux.data.PagingStore extension made by Condor because I need local store for paging my ExtJs grid. But, there is problem with this extension. The grid paging toolbar always set the current page cursor at page 2 while the store is empty.

After searching at sencha forum, I've found this solution was succesfully solve my problem with Ext.ux.data.PagingStore.

Just add a constructor for Ext.ux.data.PagingStore:
constructor: function(config) {
        this.totalLength = 0;
        Ext.ux.data.PagingStore.superclass.constructor.call(this, config);
},

and ... At the beginning of the Ext.ux.PagingToolbar's onChange method:
Change the code
if (this.cursor >= t) {
     this.cursor = Math.ceil((t + 1) / s) * s;
}
into like this:
if (this.cursor >= t && this.cursor > 0) {
     this.cursor = Math.ceil((t + 1) / s) * s;
}




The link to sencha forum thread is:
http://www.sencha.com/forum/showthread.php?71532-Ext.ux.data.PagingStore-v0.5&p=624509&viewfull=1#post624509

Hopefully that save your headache too.. :)

Tidak ada komentar:

Posting Komentar