Re-sorting not working... What can I do?

Re-sorting not working... What can I do?

vertuzzivertuzzi Posts: 6Questions: 0Answers: 0
edited April 2012 in General
Hi!

I'm having a small issue with my datatable. In the table that I made (not using Ajax), values can be changed in some of the columns, and then if I click on the top of the column to sort, the sorting works fine. However, I'd like that on some events, the table be re-sorted automatically.

i tried, after the event:

[code]
var oTable = $('#table').dataTable();
oTable.fnSort( [[10,'asc']] )
[/code]

However, it's not re-sorting it... My table is defined as:

[code]
$('#table').dataTable({
'bSort' : true,
'bRetrieve' : true,
'iDisplayLength' : 25,
'aaSorting': [[10, 'asc']],
'aLengthMenu': [[25, 50, 100, -1], [25, 50, 100, 'All']],
"sScrollX": "100%",
'aoColumns' : [
{'bSortable': false},
{'bSortable': false},
{'sType' : 'ranking'},
{'sType' : 'num-rows'},
{'sType' : 'num-rows'},
{'sType' : 'num-rows'},,
{'sType' : 'num-rows'},
{'sType' : 'num-rows'},
{'sType' : 'num-rows'},
{'sType' : 'num-rows'},
{'sType' : 'num-rows'},
]
})
[/code]

What am I missing?

Thank you!

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Other than the errors on lines 14 and 19 (too many commas / trailing comma) it looks okay. Can you please link me to your test case?

    Allan
This discussion has been closed.