Results 1 to 5 of 5

Thread: [4.1.0-rc2] Ext.view.Table is wonky

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-5841 in a recent build.
  1. #1
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default [4.1.0-rc2] Ext.view.Table is wonky

    1) View the Cell Editing Grid Example in Chrome with the console open
    /path/to/ext-4.1.0-rc2/examples/grid/cell-editing.html
    2) Dismiss the "Store Load Callback" dialog
    3) Delete the first plant in the grid (Adder's-Tongue) using the delete icon
    4) Press the down arrow key while watching the console
    5) Kaboom:
    Uncaught TypeError: Cannot read property 'row' of undefined
    Ext.define.walkCells (ext-all-debug.js:105350)

    [edit]
    There are quite a no. of methods in view.Table which use a "position" object without first checking if it is null. It might be a good idea for view.Table#getPosition() to always return a valid, non-null "position" object in this case.
    Last edited by mystix; 5 Apr 2012 at 3:44 AM. Reason: added note

  2. #2
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Here's another test-case which demonstrates wonkiness in another view.Table method -- getCellByPosition()

    Drop the following HTML + accompanying JSON into the
    /path/to/ext-4.1.0-rc2/examples/grid
    directory


    HTML file (wonky.html):
    Code:
    <html>
    <head>
        <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
    
        <script type="text/javascript" src="../../ext-all-debug.js"></script>
    
        <script>
            Ext.Loader.setConfig({
                enabled: true
            });
    
    
            Ext.define('GenericModel', {
                extend: 'Ext.data.Model',
                proxy: {
                    type: 'ajax',
                    url: 'records.js',
                    reader: {
                        root: 'records',
                        type: 'json'
                    }
                }
            });
    
    
            Ext.onReady(function(){
                var grid = Ext.create('Ext.grid.Panel', {
                    title: 'test',
                    store: {
                        model: 'GenericModel',
                        remoteSort: true,
                        autoLoad: true,
                        listeners: {
                            metachange: function(store, meta) {
                                grid.reconfigure(null, meta.columns);
                            }
                        }
                    },
                    columns: [], // required -- grid will throw an error otherwise
                    selType: 'cellmodel',
                    plugins: [{
                        ptype: 'cellediting',
                        clicksToEdit: 1
                    }]
                });
    
                Ext.create('Ext.container.Viewport', {
                    layout: 'fit',
                    items: grid
                });
            });
        </script>
    </head>
    <body>
    </body>
    </html>
    accompanying JSON file (records.js):
    Code:
    {
        "metaData": {
            "idProperty": "id",
    
            "fields": [
                {
                    "name": "common",
                    "type": "string"
                }
            ],
    
            "columns": [
                {
                    "text": "#",
                    "xtype": "rownumberer"
                },
                {
                    "dataIndex": "common",
                    "editor": {
                        "allowBlank": false
                    },
                    "flex": 1,
                    "text": "Common Name"
                }
            ]
        },
    
        "records": [
            {
                "id": 1,
                "common": "Bloodroot"
            },
            {
                "id": 2,
                "common": "Cowslip"
            },
            {
                "id": 3,
                "common": "Columbine"
            },
            {
                "id": 4,
                "common": "Marsh Marigold"
            },
            {
                "id": 5,
                "common": "Dutchman's-Breeches"
            }
        ],
    
        "total": 5
    }
    To reproduce the wonkiness:
    1) Load the html page in Chrome with the console open
    2) Click any cell to commence editing
    3) Click the grid header to sort the column
    4) Click on the empty space beneath the last row
    5) Press the down arrow key
    6) Kaboom:
    Uncaught TypeError: Cannot read property 'row' of undefined
    Ext.define.getCellByPosition (ext-all-debug.js:105022)
    Last edited by mystix; 5 Apr 2012 at 3:47 AM. Reason: included instructions

  3. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791

    Default

    Your first test case no longer errors using the latest nightly build. However, the second test case still does.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Thanks Marc, I think I got them all now!

  5. #5
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Couldn't resist

    catchem.jpeg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •