Reorder render columns
Reorder render columns
mgraham
Posts: 1Questions: 1Answers: 0
I am using reorder feature to reorder columns, but on columns that use the render function. The headers will move but not the column with the data. When I remove the render function, the reorder works.
Thanks,
Matt
var oTable = $("#project_overview_table").DataTable( {
"dom": 'Bfrtip',
"ServerSide": true,
"Processing": true,
"ajax": "get_mts_data.php",
"dataType":'json',
"type":"POST",
"deferRender": true,
"scrollY": 500,
"scrollX": true,
"scroller": true, // do not touch MLG
"bScrollInfinite": false, //false
"bScrollCollapse": false, // false
"bAutoWidth": true, //true
"bJQueryUI": true,
"bSortClasses": false,
"bStateSave": true,
"orderClasses": false,
"colReorder": true,
"sCookiePrefix": "ProjectX_",
"oLanguage": {
"sSearch": "Search Table: _INPUT_"
},
"columnDefs": [
{
"render": function ( data, type, row ) {
return '<b>'+ row[1]+'</b>';
},
"targets": 1
},
{
"render": function ( data, type, row ) {
return '<b>'+ row[2]+'</b>';
},
"targets": 2
}]
});
This discussion has been closed.