Issue with column's width when server-side processing enabled
Issue with column's width when server-side processing enabled
Hi,
The behaviour is a bit strange : whenever I interact with the table (paging, sorting, ...), the column's width evolves, depending on the cell's content.
Is it a known issue ? Is there any workaround ?
Here are the debug data : http://debug.datatables.net/oroluq
Thanks !
The behaviour is a bit strange : whenever I interact with the table (paging, sorting, ...), the column's width evolves, depending on the cell's content.
Is it a known issue ? Is there any workaround ?
Here are the debug data : http://debug.datatables.net/oroluq
Thanks !
This discussion has been closed.
Replies
Allan
Do you mean there's nothing strange as Datatables cannot compute each column's max width (because of Data are still not loaded) ?
For the test case, it will be a bit hard (web service that produces JSON and web application deployed locally). Maybe you have some JSON data available through the Internet so I could try to write a jsfiddle ?
[code] ...
"fnInitComplete": function() {
this.fnAdjustColumnSizing(true);
},
[/code]
and the columns resizing is much less ugly :-)
But, I still don't understand why there is still some changes in the column's width (a few pixels only) when the table is redrawn (after paging for instance), whereas there remain lots of space in each columns. Any idea ?
Thanks !
Allan
So, using fnAdjustColumnSizing(true) in fnInitComplete seems to be the better solution.
Is there any cons using it ? Maybe performance issues ?
To be honest, DataTables should perhaps do that automatically. I'll have a think about adding it in :-)
Allan
So I'll add it by default when server-side processing is enabled :-)
Regards,
Thibault.