1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    11
    Vote Rating
    0
    gustavoh84 is on a distinguished road

      0  

    Default Problem with bindStore and PagingToolbar

    Problem with bindStore and PagingToolbar


    Hi guys!
    I have a PagingToolbar in grid and I need to change store's proxy url. Ok, all right, except the paging continues using old store.
    I read the docs and I saw:

    Be aware that upon reconfiguring a GridPanel, certain existing settings may become invalidated. For example the configured autoExpandColumn may no longer exist in the new ColumnModel. Also, an existing PagingToolbar will still be bound to the old Store, and will need rebinding. Any plugins might also need reconfiguring with the new data.

    So I tryed to use: paging.bindStore(store) but that did not work.

    Can You help me?

    Thanks!

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,169
    Vote Rating
    28
    jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough jay@moduscreate.com is a jewel in the rough

      0  

    Default


    it should work.

    Code:
     bindStore : function(store, initial){
            var doLoad;
            if(!initial && this.store){
                if(store !== this.store && this.store.autoDestroy){
                    this.store.destroy();
                }else{
                    this.store.un('beforeload', this.beforeLoad, this);
                    this.store.un('load', this.onLoad, this);
                    this.store.un('exception', this.onLoadError, this);
                }
                if(!store){
                    this.store = null;
                }
            }
            if(store){
                store = Ext.StoreMgr.lookup(store);
                store.on({
                    scope: this,
                    beforeload: this.beforeLoad,
                    load: this.onLoad,
                    exception: this.onLoadError
                });
                doLoad = true;
            }
            this.store = store;
            if(doLoad){
                this.onLoad(store, null, {});
            }
        },

    Jay Garcia @ModusJesus || Modus Create co-founder
    Ext JS in Action author
    Sencha Touch in Action author

    Get in touch for Ext JS & Sencha Touch Touch Training

    We are also working on Video-based Sencha Touch training: Check it out here.