how to set the default sort by column
how to set the default sort by column
SkyScream
Posts: 22Questions: 1Answers: 0
I have a result of pure JSON that datatables is pulling. The first record on the results is not showing up as the first result in the table. here is my datatables code.
$('#resulttable').dataTable( {
destroy: true,
"ajax": {
"url": "../includes/views/DetailsTableJSON.php",
"type":"post",
"data": {
"cid" : <?php echo $GBAA->company_id; ?>,
"ctype" : $("#ctype").val(),
"dateF" : $("#datepickerF").val(),
"dateS" : $("#datepickerS").val(),
"sortb" : x,
"sel" : y,
"add" : z
}}
} );
Surely Datatables is rearranging the records. How do I set the arrangement to reflect exactly as the JSON array reflects when it loads?
This discussion has been closed.
Replies
hah nvm I found it: https://datatables.net/examples/basic_init/table_sorting.html
Good to hear you found it. For anyone else interested
order
is the option to set the default ordering.Allan