Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    xmoravej is on a distinguished road

      0  

    Default [ExtJS 4.2.0.179] 'lastVisibleColumn not defined' when closing tab with grid

    [ExtJS 4.2.0.179] 'lastVisibleColumn not defined' when closing tab with grid


    Hello,
    I recently migrated from 4.0.7 to 4.2.0.179 Beta and I started getting occasional ' 'lastVisibleColumn not defined' errors when closing a tab that contains a grid. When the error occurred, the GUI remained messed up - the tab contents disappeared, but the tab header remained visible and did not respond to close attempts.

    I implemented a hotfix using the following override that includes a lastColumnVisible null check. It solved my problem.

    Code:
    Ext.override( Ext.grid.header.Container, {
            getGridColumns : function ( refreshCache /* private - used in recursion*/, inResult, hiddenAncestor )
            {
              if ( !refreshCache && this.gridDataColumns )
              {
                return this.gridDataColumns;
              }
    
              var me = this,
                  result = inResult || [],
                  items, i, len, item,
                  lastVisibleColumn;
    
              hiddenAncestor = hiddenAncestor || me.hidden;
              if ( me.items )
              {
                items = me.items.items;
                for ( i = 0, len = items.length; i < len; i++ )
                {
                  item = items[i];
                  if ( item.isGroupHeader )
                  {
                    item.getGridColumns( true, result, hiddenAncestor );
                  }
                  else
                  {
                    item.hiddenAncestor = hiddenAncestor;
                    result.push( item );
                  }
                }
              }
              me.gridDataColumns = result;
    
              // If top level, correct first and last visible column flags
              if ( !inResult && len )
              {
                // Set firstVisible and lastVisible flags
                for ( i = 0, len = result.length; i < len; i++ )
                {
                  item = result[i];
                  item.isFirstVisible = item.isLastVisible = false;
                  if ( !item.hidden || item.hiddenAncestor )
                  {
                    if ( !lastVisibleColumn )
                    {
                      item.isFirstVisible = true;
                    }
                    lastVisibleColumn = item;
                  }
                }
    
                // FIX: added lastVisibleColumn null check
                if ( lastVisibleColumn != null )
                {
                  lastVisibleColumn.isLastVisible = true;
                }
              }
    
              return result;
            }
          } );

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,624
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Can I get a test case to reproduce the error?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    xmoravej is on a distinguished road

      0  

    Default


    Hello Mitchell,
    I have not put together any simplified test case yet as I seemed to have 'fixed' the problem by adding the null check. Because I have not observed any negative consequences in the app I did not investigate the issue further.

    Would a screenshot of the app's layout help?

    Cheers,
    Jan