Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7335 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2011
    Posts
    30
    Vote Rating
    2
    dpchrist is on a distinguished road

      0  

    Question Grid reconfigure change with 4.1.2

    Grid reconfigure change with 4.1.2


    When calling reconfigure() on a grid, you can pass a store and a columns parameter. The documentation says:

    Reconfigures the grid with a new store/columns. Either the store or the columns can be omitted if you don't wish to change them.

    This was true in 4.1.1, but after installing 4.1.2 last week, our grids started having problems. This is because code was added to the reconfigure() function to always unbind the current store:

    Code:
                if (me.store) {
                    me.unbindStore();
                }
    The store property now always gets nulled out after calling reconfigure() and we start having problems.

    I have resolved this by always passing in the current store to the reconfigure() call, but want to make this this is correct and that the documentation just needs to be updated.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,990
    Vote Rating
    455
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker to update API

    Scott

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Montréal, Canada
    Posts
    220
    Vote Rating
    5
    Christiand is on a distinguished road

      2  

    Default


    To fix while waiting for the next version..

    Code:
    Ext.override(Ext.panel.Table, {
    
    
        reconfigure: function(store, columns) {
            var me = this,
                oldStore = me.store,
                headerCt = me.headerCt,
                oldColumns = headerCt ? headerCt.items.getRange() : me.columns;
    
    
            // Make copy in case the beforereconfigure listener mutates it.
            if (columns) {
                columns = Ext.Array.slice(columns);
            }
    
    
            me.fireEvent('beforereconfigure', me, store, columns, oldStore, oldColumns);
            if (me.lockable) {
                me.reconfigureLockable(store, columns);
            } else {
                Ext.suspendLayouts();
                if (columns) {
                    // new columns, delete scroll pos
                    delete me.scrollLeftPos;
                    headerCt.removeAll();
                    headerCt.add(columns);
                }
                if (store) {
                    //moved following "if" block inside the "if (store)" block
                    if (me.store) {
                        me.unbindStore();
                    }
                    store = Ext.StoreManager.lookup(store);
                    me.bindStore(store);
                } else {
                    me.getView().refresh();
                }
                headerCt.setSortState();
                Ext.resumeLayouts(true);
            }
            me.fireEvent('reconfigure', me, store, columns, oldStore, oldColumns);
        }
    
    
    });

Thread Participants: 2

Tags for this Thread