I would like to configure client side sorting.
But I do not succeed in running fnSort.
I get data via ajax (static data for dev purpose), and I bind the fnSort to the th click event:
Data are correctly displayed, click handlers is correctly bound. I have also checked that oSettings.aaSorting has been changed. But no sort occurs.
Besides this, the "click event" is bound once more each time fnHeaderCallback runs. I hacked this using the unbind method before the click method. Why do multiple bindings occur?
But I do not succeed in running fnSort.
I get data via ajax (static data for dev purpose), and I bind the fnSort to the th click event:
, "sAjaxSource": "data/data.txt"
, "fnHeaderCallback" : function(nHead, aData, iStart, iEnd, aiDisplay){
var ths = $(nHead).find('th');
for(i = 0; i<ths.length; i++){
var $thsi = $(ths[i]);
$thsi.unbind('click').click({"index" : i}, function(e){
$table.fnSort( [ [e.data.index, 'asc'] ] );
});
}
}
Data are correctly displayed, click handlers is correctly bound. I have also checked that oSettings.aaSorting has been changed. But no sort occurs.
Besides this, the "click event" is bound once more each time fnHeaderCallback runs. I hacked this using the unbind method before the click method. Why do multiple bindings occur?