sScrollY - height to be set dynamically

sScrollY - height to be set dynamically

neuDev33neuDev33 Posts: 11Questions: 0Answers: 0
edited November 2012 in DataTables 1.9
Firstly, DataTables has proven to have more features than I ever expected, so thank-you Allan for all the work!

I know this question has been asked before
here - http://datatables.net/forums/discussion/2996/how-to-adjust-sscrolly-with-respect-to-parent-container/p1
and here - http://datatables.net/forums/discussion/10219/make-sscrolly-dynamic/p1

However, none of these solutions work for me. In my case, I have a master detail setup, where the head div containing DataTables occupies the top half of the screen and the details div occupies the bottom half of the screen. However, the user can manually change this layout to be horizontally side by side, in which case, height of datatables should increase to span the parent container. This works when I resize the window, but doesn't work when the user manually changes the views.

Here's some code -

On window resize, I have -
$(window).resize(function () {
$(".dataTables_scrollBody").height($("#headDiv").height());
oTable.fnDraw();
oTable.fnAdjustColumnSizing();
}
And the above code works fine.

And when the view is changed, I have -
$("div.dataTables_scrollBody").height($("#headDiv").height());
oTable.fnDraw();
This does not work.

Any suggestions how I can achieve this.

P.S. Im using DataTables 1.9.4
This discussion has been closed.