1. #1
    Sencha User
    Join Date
    Dec 2008
    Posts
    8
    Vote Rating
    0
    zjda is on a distinguished road

      0  

    Default Store locding problem with buffered: true,

    Store locding problem with buffered: true,


    Hi All,

    I am trying to make it more restful by dynamically setting proxy url. This is my store code:

    Code:
        buffered: true,
        leadingBufferZone: 4,
        pageSize: 2,
        proxy: {
            setGroupId: function(id) {this.url = '../rest/admin/group/' + id + '/user'},        
            type: 'ajax',
            url: '../rest/admin/group/0/user',
            reader: {
                type: 'json',
                root: 'user',
                totalProperty: 'total',
                successProperty: 'success'
            },
        },
        remoteSort: true,
        simpleSortMode: true,
        sorters: [{
            property: 'name',
            direction: 'ASC'
        }],
        autoLoad: false,
        groupId:0,
        load4Group: function(id) {
            if (id != this.groupId) {
                this.removeAll(true),
                this.groupId = id;
                this.proxy.setGroupId(id);
                this.pageMap.clear();
                   this.load({
                       scope: this,
                       callback: function(records, operation, success) {
                           console.log(records);
                       }
                   });
            }
        }
    First time when calling load4Group(), it works fine. The value of "total" is 2 and it sends only one request to the server for page 1. However, afterward it will send 3 requests to the server to get pages 1, 2 and 3 even though the "total" value is 2 in these responses. The loading mask will never go way. I try to use removeAll and pageMap.clear to rest the buffer, but it does not help. If I set "buffered: false", the problem will NOT occur.

    Any suggestion will be appreciated.

    Thanks,
    -ZJ

  2. #2
    Sencha User
    Join Date
    Dec 2008
    Posts
    8
    Vote Rating
    0
    zjda is on a distinguished road

      0  

    Default


    The following code fixes the problem:

    Code:
        load4Group: function(id) {
            if (id != this.groupId) {
                this.groupId = id;
                this.proxy.setGroupId(id);
                this.removeAll();
                if (this.prefetchData) {
                    this.prefetchData.clear(); 
                    delete this.guaranteedStart;
                    delete this.guaranteedEnd;
                    delete this.totalCount;
                }
                this.guaranteeRange(0, this.pageSize - 1); 
            }
        }
    Thanks,
    -ZJ

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi