oSettings == null
oSettings == null
shawnrummel
Posts: 3Questions: 0Answers: 0
I have been battling an issue in which the function _fnSettingsFromNode was returning null. Even the the table should have been the same something ( I am not sure of the exact difference ). I had tried to to modify that function to compare by id but that didn't work. What I ended up changing that did work was to modify the following block in jquery.dataTables.js. The part that makes me nervous is I am not clear on what exactly is being done in the block. Can anyone confirm if this valid resolution and not just a hack. Though if the hack works I'll stick with it.
[code]
/* If the element we are initialising has the same ID as a table which was previously
* initialised, but the table nodes don't match (from before) then we destroy the old
* instance by simply deleting it. This is under the assumption that the table has been
* destroyed by other methods. Anyone using non-id selectors will need to do this manually
*/
// if ( DataTable.settings[i].sTableId == this.id )
if ( DataTable.settings[i].nTable === this )
{
DataTable.settings.splice( i, 1 );
break;
}
[/code]
[code]
/* If the element we are initialising has the same ID as a table which was previously
* initialised, but the table nodes don't match (from before) then we destroy the old
* instance by simply deleting it. This is under the assumption that the table has been
* destroyed by other methods. Anyone using non-id selectors will need to do this manually
*/
// if ( DataTable.settings[i].sTableId == this.id )
if ( DataTable.settings[i].nTable === this )
{
DataTable.settings.splice( i, 1 );
break;
}
[/code]
This discussion has been closed.
Replies
Please link to a test case.
Having said that, the change looks fine, but I don't understand why it is needed - DatTables will add a unique ID to a table if it must.
Allan