DataTables with UI Tabs problem
DataTables with UI Tabs problem
hello;
First, great job on this plug-in. You have created a very valuable addition to jQuery.
The problem:
I have implemented two datatables in a jQuery Tab (UI Tabs) identical to the code here: http://www.datatables.net/examples/api/tabs_and_scrolling.html
The problem is that the example is using the "sScrollY" option. I do not want this option. But if I remove this option it removes the from the DOM and renders the following useless.
var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
So now when i go back and fourth between tabs the above line always return oTable.length = 0
As a result my datatable in the 2nd tab does not get proper widths. I want to use 100% width on both datatables.
First, great job on this plug-in. You have created a very valuable addition to jQuery.
The problem:
I have implemented two datatables in a jQuery Tab (UI Tabs) identical to the code here: http://www.datatables.net/examples/api/tabs_and_scrolling.html
The problem is that the example is using the "sScrollY" option. I do not want this option. But if I remove this option it removes the from the DOM and renders the following useless.
var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
So now when i go back and fourth between tabs the above line always return oTable.length = 0
As a result my datatable in the 2nd tab does not get proper widths. I want to use 100% width on both datatables.
This discussion has been closed.
Replies
[code]
var oTableInit = $('div.dataTables_wrapper>table.display', ui.panel).dataTable();
[/code]
Hope this helps.
Actually the problem was something else. The example uses the following code to auto adjust the height of the table.
[code]
$j("#tabs").tabs( {
"show": function(event, ui) {
var oTable = $j('div>table.display', ui.panel).dataTable();
if ( oTable.length > 0 ) {
oTable.fnAdjustColumnSizing();
}
}
});
[/code]
In my case I do not need this at all. I just needed to add
[code]"bAutoWidth": false [/code]
to the settings and i get 100% width.