default sorting of table on page load

default sorting of table on page load

kumarskumars Posts: 7Questions: 0Answers: 0
edited August 2013 in General
Hi,
I have multiple table on my webpage. I would like to sort one table based on third column but it is not working. I don't know where I am doing wrong.
Here is my code:



$(document).ready(function() {
var table5 = $('#table5').dataTable({
"bJQueryUI": true,
"bLengthChange": true,
"bFilter": false,
"aaSorting": [[2,'desc']],
});








position
Residue
Score
pred
Coscore
order pred
Conscore



{{for row in data[2:]:}}


{{=row[0]}}
{{=row[1]}}
{{=row[2]}}
{{=row[3]}}
{{=row[4]}}
{{=row[5]}}
{{=row[6]}}

{{pass}}









Please let me know where I am doing wrong.

Thanks

Replies

  • tihg7947tihg7947 Posts: 9Questions: 0Answers: 0
    [quote] [/quote]

    add name="table5" ?
  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Looks like it should work to me. Please, as requested in the new thread page, link to a test case so we can offer help: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Oh and yes - as tihg7947, your jQuery selector is an ID which doesn't exist.
This discussion has been closed.