1. #1
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,569
    Vote Rating
    56
    Animal will become famous soon enough Animal will become famous soon enough

      0  

    Default [2.0+][CLOSED]GridPanel.reconfigure can invalidate certain configs

    After reconfigure, certain existing configurations may become in valid and cause errors.

    One such is autoExpandColumn. The Grid might be reconfigured so that the specified column does not exist which causes a runtime error when the View tries to auto expand column index -1.

    The fix for this one:

    Code:
        reconfigure : function(store, colModel){
            if(this.loadMask){
                this.loadMask.destroy();
                this.loadMask = new Ext.LoadMask(this.bwrap,
                        Ext.apply({store:store}, this.initialConfig.loadMask));
            }
            this.view.bind(store, colModel);
            this.store = store;
            this.colModel = colModel;
            if (this.autoExpandColumn && (this.colModel.getIndexById(this.autoExpandColumn) == -1)) {
                delete this.autoExpandColumn;
            }
            if(this.rendered){
                this.view.refresh(true);
            }
        },

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956
    Vote Rating
    18
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default

    Along with reconfiguring, you would need to also update any settings that you set. Ext can't guess what settings you have set and which are invalid. Another example would be a listener that listens for a particular event by column, only that column no longer exists. Ext can't fix that either. This wouldn't be a bug in Ext, it would be a bug in the underlying application code.
    Jack Slocum
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,569
    Vote Rating
    56
    Animal will become famous soon enough Animal will become famous soon enough

      0  

    Default

    OK, maybe we need a reconfigure event then. Because If you look at where that code is necessary, it has to be executed before the refresh.

    Some extra resetting functionality has to be injected before the refresh takes place. It must go there because all sorts of things can change. GridFilters (or other plugins) may need to be unbound from the Store and Grid, PagintToolbars need to be unbound and rebound etc.

Thread Participants: 1