Re-sorting not working... What can I do?
Re-sorting not working... What can I do?
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!
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!
This discussion has been closed.
Replies
Allan