fnAddData and fnRender screws things up royally
fnAddData and fnRender screws things up royally
bidon
Posts: 28Questions: 0Answers: 0
I'm using what everyone on this site seems to do, the same code nearly. I want to refresh the table and keep existing sort, pagination etc.
So I use fnReloadAjax, using the text everywhere on this site. It calls oSettings.fnServerData which calls that.oApi._fnAddData which then finally renders the data with fnRender (to format it the way I want). On FF, this all works as designed.
However, on IE/Chrome some columns (no idea which) the TDs with the data in them from fnRender get changed. The width of the TD and it's contents change to "auto" instead of their previous fixed with. Verified this in IE and FF.
So this width change, basically causes the columns to change widths in a very small, but bad way. Refresh often enough, and you can't see jack.
Any idea how to fix this? Because I'd hate to ditch the table having spent all this time. However, unfortunately, we still live in a world with IE as the target browser. This seems like an issue with the table itself.
So I use fnReloadAjax, using the text everywhere on this site. It calls oSettings.fnServerData which calls that.oApi._fnAddData which then finally renders the data with fnRender (to format it the way I want). On FF, this all works as designed.
However, on IE/Chrome some columns (no idea which) the TDs with the data in them from fnRender get changed. The width of the TD and it's contents change to "auto" instead of their previous fixed with. Verified this in IE and FF.
So this width change, basically causes the columns to change widths in a very small, but bad way. Refresh often enough, and you can't see jack.
Any idea how to fix this? Because I'd hate to ditch the table having spent all this time. However, unfortunately, we still live in a world with IE as the target browser. This seems like an issue with the table itself.
This discussion has been closed.
Replies
Allan
Did you try adding sWidth to a column as I suggested?
Allan
I totally get it, I'm trying to minimize/isolate the problem so I can send some offline files that you can look at.
More to come...
TABLE
{
border-collapse: collapse;
}
If above is in a CSS file, somehow causes the issue. Remove it, it works fine.
Thoughts?
Until then, you might want to consider something like this which will give the same visual effect:
[code]
div.dataTables_wrapper table {
border-bottom: 1px solid black;
border-right: 1px solid black;
}
div.dataTables_wrapper table th,
div.dataTables_wrapper table td {
border-top: 1px solid black;
border-left: 1px solid black;
border-bottom: none;
}
div.dataTables_wrapper div.dataTables_scrollHead table {
border-bottom: none;
}
[/code]
See also this thread for more information: http://datatables.net/forums/discussion/9350/scrollable-datatable-header-is-not-alligned-with-data/p1#Item_4
Allan