fnGetPosition(cell) doesn't work with nested tables
fnGetPosition(cell) doesn't work with nested tables
lxs
Posts: 2Questions: 0Answers: 0
I have a table that has tables inside the cells (in divs).
fnGetPosition doesn't work properly when called on any cell which comes after a cell with a table in it. fnGetPosition looks for all tds inside the cell's row and ends up getting the sub-table's cells mixed into the array. Instead it should be only looking for the tds which are direct children of the row.
I've worked around this by just using th for the sub-table's cells and re-styling them, but it would be nice to be able to use tds in sub-tables.
fnGetPosition doesn't work properly when called on any cell which comes after a cell with a table in it. fnGetPosition looks for all tds inside the cell's row and ends up getting the sub-table's cells mixed into the array. Instead it should be only looking for the tds which are direct children of the row.
I've worked around this by just using th for the sub-table's cells and re-styling them, but it would be nice to be able to use tds in sub-tables.
This discussion has been closed.
Replies
Good question, and I think I have an answer as well. If you have a look at the DataTables source code and find:
[code]
if ( oSettings.aoData[i].nTr.getElementsByTagName('td')[j-iCorrector] == nNode )
[/code]
and replace that with:
[code]
if ( $('>td', oSettings.aoData[i].nTr)[j-iCorrector] == nNode )
[/code]
does that fix it for you?
Allan