How to re-size ALL dataTables in jQuery UI Tabs?
How to re-size ALL dataTables in jQuery UI Tabs?
uline
Posts: 4Questions: 0Answers: 0
Dear Allan,
In http://www.datatables.net/release-datatables/examples/api/tabs_and_scrolling.html: you said that "An optimisation could be added to re-size ONLY OF THE FIRST showing of the table"
But in my project I need to place 2 or 3 dataTables in a jQuery UI tab, please show me the way to re-size ALL the table here in the tab.
Thanks and best regards,
Uline.
In http://www.datatables.net/release-datatables/examples/api/tabs_and_scrolling.html: you said that "An optimisation could be added to re-size ONLY OF THE FIRST showing of the table"
But in my project I need to place 2 or 3 dataTables in a jQuery UI tab, please show me the way to re-size ALL the table here in the tab.
Thanks and best regards,
Uline.
This discussion has been closed.
Replies
[code]
$('div.dataTables_scrollBody>table.display').each( function () {
...
} );
[/code]
And then call the resize function on that ( $(this).dataTable().fnAdjustColumnSizing(); for example).
An alternative is to use the iApiIndex option - but the above is easier!
Allan
Thank you so much, but I still need your help to change the below code in order to follow your guide.
$('#tabABC').tabs
(
{"show": function(event, ui)
{
var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
if ( oTable.length > 0 ) {oTable.fnAdjustColumnSizing()}
}
}
);
Look forward to hearing from you.
Uline
[code]
$('div.dataTables_scrollBody>table.display').each( function () {
$(this).dataTable().fnAdjustColumnSizing();
} );
[/code]
Thank you very much Allan.
Uline.
The other option is to enable x-scrolling in the table using sScrollX .
Allan