DataTables Extra Scroller
DataTables Extra Scroller
garrettwong
Posts: 2Questions: 0Answers: 0
Whenever a user selects a different option, I am refreshing the Data Source property "aaData" and using "bDestroy": true. However, when the table is reconstructed, there is no table header (column names). Does anyone know how I can get this to work?
I'm using the below code (aoColumns is not working)
var oTable = $('#example').dataTable({
"aaData": source,
"bJQueryUI": true,
"aaSorting": [],
"aoColumns": [
{ "sTitle": "ID" },
{ "sTitle": "Test" },
{ "sTitle": "Type" },
{ "sTitle": "Request Date" }
],
"bDestroy": true,
"sScrollY": "380px",
"sDom": 'frtiS',
"bDeferRender": true,
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).attr('id', "row-" + aData[0]);
return nRow;
}
});
Thanks.
I'm using the below code (aoColumns is not working)
var oTable = $('#example').dataTable({
"aaData": source,
"bJQueryUI": true,
"aaSorting": [],
"aoColumns": [
{ "sTitle": "ID" },
{ "sTitle": "Test" },
{ "sTitle": "Type" },
{ "sTitle": "Request Date" }
],
"bDestroy": true,
"sScrollY": "380px",
"sDom": 'frtiS',
"bDeferRender": true,
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).attr('id', "row-" + aData[0]);
return nRow;
}
});
Thanks.
This discussion has been closed.
Replies
// Called in Console
var oTable = $('#example').dataTable({
"aoColumns":["Request","Test","Name","Date","Success"],
"bDestroy":true,
"sScrollY": "380px",
"sAjaxSource": "data/2500.txt",
"sDom": "frtiS",
"bDeferRender": true,
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).attr('id', "row-" + aData[0]);
return nRow;
}
});
Allan