1. #1
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

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

    [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
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    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
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      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