Scroller plugin and CSS issue

Scroller plugin and CSS issue

ThibThib Posts: 51Questions: 2Answers: 0
edited January 2013 in Plug-ins
Hi !

I face a strange issue with the Scroller plugin.

The HTML markup :

[code]



Id
FirstName
LastName
City
Mail



...


[/code]

The Javascript code looks like this :

[code]
var oTable_myTableId;
var oTable_myTableId_params = {
"sDom":"lfrtipS",
"sScrollY":"300px",
"aoColumns":[
{
"bSortable":true
},
{
"bSortable":true
},
{
"bSortable":true
},
{
"bSortable":true
},
{
"bSortable":true
}
]
};
$(document).ready(function(){
oTable_myTableId = $('#myTableId').dataTable(oTable_myTableId_params);
$('#myTableId').show();
});
[/code]

The jQuery show() call works well in all other examples but not with the Scroller plugin : the table still has the "display:none;" CSS.

Any idea ?

Debug data : http://debug.datatables.net/uniyud
And for once, a demo : http://demo.dev.datatables4j.cloudbees.net/plugins/scroller :-)

Thanks !

Replies

  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin
    You must have the table visible for Scroller to be able to calculate the height of the rows. if the table is hidden, then the browser does not calculate height / width (since it doesn't need to). That's why it doesn't work here. The same applied to scrolling in general in DataTables (which is why fnAdjustColumnSizing needs to be called once they able is made visible).

    Allan
  • ThibThib Posts: 51Questions: 2Answers: 0
    Okkaayyy !

    I have strange behaviours with the other plugins too (ColReorder and FixedHeader) but I'll investigate a bit more before disturbing you !

    Thanks Allan ! :-)
This discussion has been closed.