__row_selector/__selector_run JQuery error

__row_selector/__selector_run JQuery error

vogomatixvogomatix Posts: 38Questions: 3Answers: 7
edited June 2014 in Bug reports

I have 2 paginated tables, and I am trying to delete a row on one table in a similar manner to that of the delete single row example.

When I run it, the row('.selected') crashes in jQuery with the error message:

Uncaught TypeError: Cannot read property 'nodeType' of null

Further investigation seems to show that the settings.aoData array contains 39 elements, but only 10 of them (those visible on the page) have the nTr attribute set - the remainder have nTr set to null.

When the null elements hit the jQuery filter method, the above error message occurs.

I have patched this by changing the loop which prepares the node list. However I am not entirely satisfied with my solution as I am uncertain whether the elements should be null in the first place.

                     var node,nodes = [];
                     for ( var i=0, ien=rows.length ; i<ien ; i++ ) {
                           node = settings.aoData[ rows[i] ].nTr;
                           if (node) nodes.push( node );
                     }

This problem occurs in both DataTables 1.10.0 and the current nightly build. I apologise for not putting a jsFiddle or similar, but I hope this is enough information

Update: this problem seems to occur on paginated datatables and stops occuring if all pages of the table are viewed before a delete is attempted. This could be because not all rows of the table are rendered until all pages have been viewed

This discussion has been closed.