dynamically changing the height of the sScrollY

dynamically changing the height of the sScrollY

SrilakshmiSrilakshmi Posts: 35Questions: 6Answers: 0

Hi ,
I have initially set the value of sScrollY
"sScrollY":300px,
later,
on clicking the inner row I want to change the value of sScrollY to 100px,
hence in the format(d) function I used the following piece of code,
var Table = $('#example').dataTable();
var NewHeight = 100;
var oSettings = Table.fnSettings();
oSettings.oScroll.sY = NewHeight + "px";
Table.fnDraw();
but it does not work,
looking forward for a reply.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    You want to avoid using the settings object as much as possible. it is considered to be private and settings values in it can cause unexpected things to happen.

    At the moment, the way to set the height of the scrolling table is to use something like: $('div.dataTables_scrollBody').height( 100 );.

    Allan

  • SrilakshmiSrilakshmi Posts: 35Questions: 6Answers: 0

    Thanks allan

This discussion has been closed.