Results 1 to 2 of 2

Thread: Problem with bindStore and PagingToolbar

  1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    11
    Vote Rating
    0
      0  

    Default 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 User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    86
      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, {});
            }
        },

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •