oTable.fnSettings().oScroll.sY = whatever;
$('div.dataTables_scrollBody').height( whatever );
$dataTableWrapper.find(".dataTables_scrollHead").height();
$(select some elements).each(function() {
$(this); // each iteration $(this) is your jquery wrapped of the current element
});
/**
* UI Layout Callback: resizePaneDataTables
*
* This callback is used when a layout-pane contains 1 or more DataTable objects.
* - whether the DataTable is a child of the pane or is nested within other elements
* Assign this callback to the pane.onresize event:
*
* SAMPLE:
* $("#elem").tabs({ show: $.layout.callbacks.resizePaneDataTables });
* $("body").layout({ center__onresize: $.layout.callbacks.resizePaneDataTables });
*
* Version: 1.0 - 2012-07-06
* Author: Robert Brower (atomofthought@yahoo.com)
*/
; (function ($) {
var _ = $.layout;
// make sure the callbacks branch exists
if (!_.callbacks) _.callbacks = {};
_.callbacks.resizePaneDataTables = function (x, ui) {
// may be called EITHER from layout-pane.onresize OR tabs.show
var $P = ui.jquery ? ui : $(ui.panel);
// find all VISIBLE data tables inside this pane and resize them
$($.fn.dataTable.fnTables(true)).each(function(i, table) {
var $table = $(table);
if ($.contains($table.get(), $P)) {
var $dataTable = $table.dataTable();
$dataTable.fnAdjustColumnSizing(false);
var $dataTableWrapper = $table.closest(".dataTables_wrapper");
var panelHeight = $dataTableWrapper.parent().height();
var toolbarHeights = 0;
$dataTableWrapper.find(".fg-toolbar").each(function(i, obj) {
toolbarHeights = toolbarHeights + $(obj).height();
});
var scrollHeadHeight = $dataTableWrapper.find(".dataTables_scrollHead").height();
var height = panelHeight - toolbarHeights - scrollHeadHeight;
$dataTableWrapper.find(".dataTables_scrollBody").height(height - 24);
$dataTable.fnDraw();
}
});
};
})(jQuery);
/**
* UI Layout Callback: resizePaneDataTables
*
* This callback is used when a layout-pane contains 1 or more DataTable objects.
* - whether the DataTable is a child of the pane or is nested within other elements
* Assign this callback to the pane.onresize event:
*
* SAMPLE:
* $("#elem").tabs({ show: $.layout.callbacks.resizePaneDataTables });
* $("body").layout({ center__onresize: $.layout.callbacks.resizePaneDataTables });
*
* Version: 1.0 - 2012-07-06
* Author: Robert Brower (atomofthought@yahoo.com)
*/
; (function ($) {
var _ = $.layout;
// make sure the callbacks branch exists
if (!_.callbacks) _.callbacks = {};
_.callbacks.resizePaneDataTables = function (x, ui) {
// may be called EITHER from layout-pane.onresize OR tabs.show
var $P = ui.jquery ? ui : $(ui.panel);
// find all VISIBLE data tables inside this pane and resize them
$($.fn.dataTable.fnTables(true)).each(function(i, table) {
var $table = $(table);
if ($.contains($table.get(), $P)) {
var $dataTable = $table.dataTable();
$dataTable.fnAdjustColumnSizing(false);
var $dataTableWrapper = $table.closest(".dataTables_wrapper");
var panelHeight = $dataTableWrapper.parent().height();
var toolbarHeights = 0;
$dataTableWrapper.find(".fg-toolbar").each(function(i, obj) {
toolbarHeights = toolbarHeights + $(obj).height();
});
var scrollHeadHeight = $dataTableWrapper.find(".dataTables_scrollHead").height();
var height = panelHeight - toolbarHeights - scrollHeadHeight;
$dataTableWrapper.find(".dataTables_scrollBody").height(height - 24);
$dataTable._fnScrollDraw();
}
});
};
})(jQuery);
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.