Header corrupted when plugin was applied for hidden div.

Header corrupted when plugin was applied for hidden div.

AlexaAlexa Posts: 2Questions: 0Answers: 0
edited July 2013 in DataTables 1.9
I have functionality based on DataTables plugin integrated with JSF Richfaces. The main table in some cases becomes hidden, parent div for table has two states: shown and hidden. When state is hidden I'm trying to add Datatables.net plugin to table. No any issues with visible state, but when I going to change hidden div to visible the header is corrupted. If I place in search field any value and click search , the header will become normal.
jQuery v1.9.1
DataTables 1.9.4

The code to install plugin


function rerenderDataTable_#{id} () {


jQuery('.datatable_id}').dataTable( {
"bJQueryUI": true ,
"bStateSave": true ,
"oColReorder": { "iFixedColumns": 1 },
"sDom": 'RC<"clear">lfrtip',
"aoColumnDefs": [{ bVisible: false, aTargets: [1] }],
"bPaginate": #{not hidePageSizeSelector},
"bDestroy":true,
"bScrollAutoCss": false,
"sScrollX": "100%",
"sScrollXInner": "100%",
"bProcessing" : true,
"sPaginationType": "full_numbers",

"sScrollY": "300px",

"bScrollCollapse": true,
"oColVis": {"aiExclude": [ 0 ]},
oLanguage: { sUrl: "../scripts/language/locale-ru.txt" }
} );

I've traced script with Firefox debugger , and found that calculation from
function function _fnScrollDraw ( o )
with call of
iSanityWidth = $(o.nTable).outerWidth();
gets the 100 instead of current table width (1400 in visible mode). But Firebug shows value in pixels, for example 1400.

this table has properties:



parent divs are:






When search is pressed, the value for header will become :







Plugins:





How I can to avoid this calculation ?

Thanks for help.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Sound alike you need to call fnAdjustColumnSizing when the table is made visible.

    Allan
  • AlexaAlexa Posts: 2Questions: 0Answers: 0
    Ok, thanks for help, it was helpful solution.
This discussion has been closed.