Server Side Default Column Order
Server Side Default Column Order
iramriquelme
Posts: 1Questions: 0Answers: 0
This is my code, and working fine:
[code]jQuery(document).ready(function() {
var oTable = jQuery('#example').dataTable( {
//"sScrollY": "100%",
//"sScrollX": "100%",
"bFilter": true,
"bAutoWidth": false,
"sPaginationType": "full_numbers",
"sDom": '<"top"ifTlp<"clear">>rt<"bottom"ilp<"clear">>',
"oTableTools": {
"sSwfPath": "<?php echo $url?>/media/swf/copy_csv_xls_pdf.swf",
"aButtons":
[
{
"sExtends": "csv",
"sButtonText": "Guardar CSV"
},
{
"sExtends": "xls",
"sButtonText": "Guardar para Excel"
}
]
},
"aLengthMenu": [[10, 25, 50, 100,-1], [10, 25, 50, 100,"Todos"]],
"bStateSave": false,
"bSort": false,
"bServerSide": true,
"bProcessing": true,
"sServerMethod": "GET",
"sAjaxSource": ajaxurl+'?action=getViaticos',
// The AJAXURL is for Wordpress Action Hook.
} );
} );[/code]
But I don't know how to set the order for the first column (ID column). I tried with aaSort but, no works. Anybody can help me?
[code]jQuery(document).ready(function() {
var oTable = jQuery('#example').dataTable( {
//"sScrollY": "100%",
//"sScrollX": "100%",
"bFilter": true,
"bAutoWidth": false,
"sPaginationType": "full_numbers",
"sDom": '<"top"ifTlp<"clear">>rt<"bottom"ilp<"clear">>',
"oTableTools": {
"sSwfPath": "<?php echo $url?>/media/swf/copy_csv_xls_pdf.swf",
"aButtons":
[
{
"sExtends": "csv",
"sButtonText": "Guardar CSV"
},
{
"sExtends": "xls",
"sButtonText": "Guardar para Excel"
}
]
},
"aLengthMenu": [[10, 25, 50, 100,-1], [10, 25, 50, 100,"Todos"]],
"bStateSave": false,
"bSort": false,
"bServerSide": true,
"bProcessing": true,
"sServerMethod": "GET",
"sAjaxSource": ajaxurl+'?action=getViaticos',
// The AJAXURL is for Wordpress Action Hook.
} );
} );[/code]
But I don't know how to set the order for the first column (ID column). I tried with aaSort but, no works. Anybody can help me?
This discussion has been closed.