"Uncaught TypeError: Cannot read properties of undefined (reading 'field')" Filtering column

Dear community, 

I have the following JS error clicking the filter icon in the columns:

Uncaught TypeError: Cannot read properties of undefined (reading 'field')
    at e.filterIconClickHandler (ej2.min.js:10)
    at e.notify (ej2.min.js:10)
    at t.notify (ej2.min.js:10)
    at t.mouseClickHandler (ej2.min.js:10)


This error does not happen at first loading of the grid.

I'm using the version 19.1.63 and jquery version 3.3.1.

You can reproduce the error at following link: https://preproduzione.zenshare.it/biblioteca/demotreeview.php doing (a demo):

1 - click in the filter icon of a column (no error shown)

2 - expand the tree and click at a node (the first child for example)

3 - click again in the filter icon and open the JS console with the error shown

Can anyone help me please, please ple?


Kind regards


3 Replies

JC Joseph Christ Nithin Issack Syncfusion Team December 8, 2021 01:28 PM UTC

Hi Alessandro, 

  Greetings from Syncfusion support. 

 Based on the provided screenshot and the sample provided, we have found that, when you select a child node of your tree view, you are re-rendering the grid in the same element without properly destroying the previous grid. We have also found that you are using the following code `$('#grid_documenti').html(" ");` for clearing already present grid in the dom level only but the events and attributes will not be cleared.  

  You can resolve this issue by properly destroying the grid using the predefined method `grid.destroy` of the EJ2 Grid which is used to destroys the component (detaches/removes all event handlers, attributes, classes, and empties the component element).   

Please find the below api documentation. 


Please get back to us for further details. 

Regards, 
Joseph I. 



AL Alessandro December 9, 2021 08:28 AM UTC

Thanks Joseph, you solved my problem and make me happy at beginning of my day :-)




JC Joseph Christ Nithin Issack Syncfusion Team December 10, 2021 04:54 AM UTC

Hi Alessandro, 

  Thanks for the update. 

  We are glad that the provided solution resolved the reported issue. 

  Please get back to us for further queries. 

Regards, 
Joseph I. 


Loader.
Up arrow icon