Custom size of column when using fixed column
Custom size of column when using fixed column
i got a problems here,
i'am currently using datatables with fixed column plugin,
it's worked for me, but now i need to custom the width of it column.
[code]
$(document).ready( function () {
var oTable = $('#tabel_daftar_all').dataTable( {
"bJQueryUI": true,
"bPaginate": false,
"sScrollX": "100%",
//"sScrollXInner": "150%",
"bScrollCollapse": true,
"bFilter": false,
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var index = iDisplayIndexFull +1;
$('td:eq(0)',nRow).html(index);
return nRow;}
} );
//Auto column resize for datatable inside tab
$("#kontenTab").tabs( {
"show": function(event, ui) {
var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
if ( oTable.length > 0 ) {
oTable.fnAdjustColumnSizing();
}
}
} );
new FixedColumns( oTable, {
"iLeftColumns": 2,
"iLeftWidth": 350
} );
} );
[/code]
in that code, i freeze 2 column (in my case, that two column is rownumber column and categories column)
but by using the iLeftWidth, it set these 2 column with fixed width (350),
how to customized these 2 column?
i want the first column to be 50, and the categories column 350
maybe anyone can help me?
thanks before..
i'am currently using datatables with fixed column plugin,
it's worked for me, but now i need to custom the width of it column.
[code]
$(document).ready( function () {
var oTable = $('#tabel_daftar_all').dataTable( {
"bJQueryUI": true,
"bPaginate": false,
"sScrollX": "100%",
//"sScrollXInner": "150%",
"bScrollCollapse": true,
"bFilter": false,
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var index = iDisplayIndexFull +1;
$('td:eq(0)',nRow).html(index);
return nRow;}
} );
//Auto column resize for datatable inside tab
$("#kontenTab").tabs( {
"show": function(event, ui) {
var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();
if ( oTable.length > 0 ) {
oTable.fnAdjustColumnSizing();
}
}
} );
new FixedColumns( oTable, {
"iLeftColumns": 2,
"iLeftWidth": 350
} );
} );
[/code]
in that code, i freeze 2 column (in my case, that two column is rownumber column and categories column)
but by using the iLeftWidth, it set these 2 column with fixed width (350),
how to customized these 2 column?
i want the first column to be 50, and the categories column 350
maybe anyone can help me?
thanks before..
This discussion has been closed.