1
votes

I have an application that works perfectly but in the console I get the following error:

Uncaught TypeError: Can not read property 'addCls' of null

But the application works correctly, because I sent this error if the application works?


I found the problem, but not how to fix it.
in my grid when I add:

features: [{ftype: 'grouping'}]

I start to get this error.

hopefully you can help me. regards

1
In chrome developer tools you can enable pause on uncaught exception to see where and at what time you get this error. - Jan S
here is where I launch the exception in ext-all-dev.js if (item && me.isRowStyleFirst(item)) { me.getRowStyleTableEl(item).addCls(me.tableOverFirstCls); } - Elias Vargas
seems something to be with highlighting the first row in a table on mouseover. but I have no clue what could be the problem... Do you use grouping? does the generated ExtJS table has this css class: x-grid-table ? - Jan S
the problem is this row: return (me.isGrouping ? Ext.fly(item) : this.el).down('table.x-grid-table'); which will return undefined if you have grouping enabled - Jan S
because if I want to group and send me this error? as I can do to be able to group without me error? - Elias Vargas

1 Answers

0
votes

The code you posted in the comment :

if (item && me.isRowStyleFirst(item)) {
    me.getRowStyleTableEl(item).addCls(me.tableOverFirstCls);
}

This code will throw that error if me.getRowStyleTableEl(item) is undefined. Grouping breaks the function me.getRowStyleTableEl().
Change the code like this to omit the .addCls. Or adapt .getRowStyleTableEl to be compatible with grouping.

if (item && me.isRowStyleFirst(item) && me.getRowStyleTableEl(item)) {
    me.getRowStyleTableEl(item).addCls(me.tableOverFirstCls);
}