This issue duplicates another issue.
  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    7
    Vote Rating
    0
    MarkWork is on a distinguished road

      0  

    Default [4.2.0 Beta] Grid with all columns hidden throws error

    [4.2.0 Beta] Grid with all columns hidden throws error


    REQUIRED INFORMATION




    Ext version tested:
    • Ext 4.2.0 Beta

    Browser versions tested against:
    • IE10
    • Chrome 23

    DOCTYPE tested against:
    • <!DOCTYPE html>

    Description:
    • If you create a grid with all columns hidden by default then you get a Javascript error.
    • This worked in previous versions.

    Steps to reproduce the problem:
    • Create a grid with all columns set to hidden:true.
    • Load page.

    Test Case:


    Code:
        Ext.define('MyApp.view.Viewport', {
            extend: 'Ext.container.Viewport',
    
    
    
    
            layout: {
                type: 'fit'
            },
    
    
    
    
            items: [
                {
                    xtype: 'gridpanel',
                    title: 'My Grid Panel',
                    columns: [
                        {
                            xtype: 'gridcolumn',
                            hidden: true,
                            dataIndex: 'string',
                            text: 'String'
                        },
                        {
                            xtype: 'numbercolumn',
                            hidden: true,
                            dataIndex: 'number',
                            text: 'Number'
                        },
                        {
                            xtype: 'datecolumn',
                            hidden: true,
                            dataIndex: 'date',
                            text: 'Date'
                        },
                        {
                            xtype: 'booleancolumn',
                            hidden: true,
                            dataIndex: 'bool',
                            text: 'Boolean'
                        }
                    ]
                }
            ]
        });
    
    
    
    
        Ext.application({
            autoCreateViewport: true,
            name: 'MyApp'
        });





    HELPFUL INFORMATION


    Debugging already done:
    • Error occurs on line 151084 of ext-all.js.
    • The error is caused because the variable lastVisibleColumn is undefined when all columns are hidden (due to the loop above only assigning visible columns to it).

    Possible fix:
    • Check for undefined before accessing lastVisibleColumn.

    Operating System:
    • Windows 8 Enterprise

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This has already been fixed for the next release.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

Thread Participants: 1