I would like have a table with normal sorting if a column is selected, but upon initial page load I would like to display the table as is. How would I go about doing this?
Are you using the latest version of DataTables? 1.5 beta 7 (or 1.4.3 if you want to stick to the 1.4 series). There was a bug a while back where you couldn't set an empty sort - but it shouldn't be a problem any more.
Replies
You can do what you are trying to achieve by passing in an empty array as the 'aaSorting' initialisation parameter. For example:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"aaSorting": [ ]
} );
} );
[/code]
Allan
iDataSort = oSettings.aoColumns[ aaSort[aaSort.length-1][0] ].iDataSort;
This is my code:
[code]$(document).ready(function() {
oTable=$('#test').dataTable( {
"aaSorting": [ ], // Prevent initial sorting
"aoData": [
{ "sType": "html" },
null,
null,
],
"sPaginationType": "full_numbers"
});
});[/code]
What am I doing wrong?
TIA.
Alessandro
Are you using the latest version of DataTables? 1.5 beta 7 (or 1.4.3 if you want to stick to the 1.4 series). There was a bug a while back where you couldn't set an empty sort - but it shouldn't be a problem any more.
Allan
Thanks a bunch!
Regards.
Alessandro