Table resize question

Table resize question

Pierce KrousePierce Krouse Posts: 40Questions: 8Answers: 1

As a folllow-on to my earlier question about setting scrollY, I have used the edit suggested by Allan, setting the height and maxHeight for the table on resize:
http://live.datatables.net/zihireli/4/edit

The on_resize call in the document.ready section is this:

windowHeight = calcWindowHeight();
var dtHeight = calcDataTableHeight();
console.log('new hght:'+dtHeight); 
$('div.dataTables_scrollBody').css('height', dtHeight, 'maxHeight', dtHeight);
oTable.columns.adjust().draw();

So my question is, why does the data table resize only some of the time, and not every time?
I can see the console.log appear, but the table will resize only (in my tests, at least) when shortened, or lengthened by a large-ish amount. If I lengthen the page enough to reveal two rows, more or less, the table won't resize. I have users that will want to 'trim' their view for screenshots, etc, and this might frustrate them.

This question has an accepted answers - jump to answer

Answers

  • Pierce KrousePierce Krouse Posts: 40Questions: 8Answers: 1
    Answer ✓

    This problem was caused by some bad code in my part, so please close.

This discussion has been closed.