Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get property 'id' of undefined or null reference

I am trying to create a Ext.PagingToolbar, which works perfectly in all major browsers including IE9 and IE 10. But in IE 8 and below, it ends up with the following error.

Unable to get property 'id' of undefined or null reference

When I traced, I found the error occurs in the following code.

var cm = new Ext.grid.ColumnModel({
    defaults: {
        sortable: true
    },
    columns:
      [
        {
            header: 'Result Set',
            dataIndex: 'result_set_name'
        },
        {
            header: 'Result Date',
            dataIndex: 'result_date',
            xtype: 'datecolumn',
            format: 'm/d/Y',
            dateFormat: 'c'
        },
        {
            header: 'Comments',
            dataIndex: 'comments'
        },
        {
           header: 'Link',
           dataIndex: 'link',
           renderer: function(value, metaData, record, rowIndex, colIndex, store) {return '<a href="'+value+'">'+value+'</a>';}
        },
      ]
});

But I cannot find the source of issue and what need to be done. Any help is appreciated.

like image 247
Saravanan Avatar asked Jul 26 '13 08:07

Saravanan


1 Answers

Your error is that you end the columns array with a comma which leads to such a error. The IE tries to read a object after the comma which will be undefined

like image 120
sra Avatar answered Nov 04 '22 00:11

sra