DataTablesSrc
DataTablesSrc copied to clipboard
"Cannot read property 'id'" of nTr error
This issue can occur when a $row.data(new_data) is called on a row whose TR element has not been rendered (e.g. my table has 500 rows, I've only rendered the first page, and I'm going to modify row 350). The offending line is in api.rows.js:
if ( $.isArray( data ) && row.nTr.id ) {
_fnSetObjectDataFn( ctx[0].rowId )( data, row.nTr.id );
}
Assuming that _fnSetObjectDataFn does not need to be called in these circumstances, would the below change be sufficient to fix the issue?
if ( $.isArray( data ) && row.nTr && row.nTr.id ) {
_fnSetObjectDataFn( ctx[0].rowId )( data, row.nTr.id );
}
Hi - thanks for posting this. Can you link to an example showing the issue please?
Thanks, Allan