我正在为 Jquery 使用数据表插件。我想按降序显示记录并且它工作正常。但是当用户单击标题复选框时,我不想再次对其进行排序,因为它会刷新并取消选中所有复选框。这是我的代码
var oTable = $('#listings_row').dataTable( {
"aaSorting": [[ 0, "desc" ]],
"aoColumns": [ null, null],
"sDom": 'R<>rt<ilp><"clear">',
"iDisplayLength": 25,
"iDisplayStart": 0,
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "test.php",
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var id = aData[0];
$(nRow).attr("id",id);
// Bold the grade for all 'A' grade browsers
if ( aData[0] != 0 )
{
$('td:eq(0)', nRow).html( '<input type="checkbox" name="delid[]" value="'+ aData[0] +'" />' );
} return nRow;
});
怎么{ "bSortable": false }
用aaSorting
?