在对标头标签进行 ajax 调用排序时,如何限制 ajax 调用。我不想要服务器端排序。我需要客户端排序。任何帮助,将不胜感激。
代码:
function InitUserTable(params){
var clientListTable= $('#clientListTable').dataTable( {
"bLengthChange" : false,
"iDisplayLength" : 10,
"bSort" : true,
"bFilter": false,
"bDestroy":true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"bAutoWidth" : false,
"sAjaxSource": "../clients/clientDataTable.do?"+params,
"fnDrawCallback": function(){
$("#clientListTable tbody tr").click( function( e ) {
if ( $(this).hasClass('datatablerowhighlight') ) {
$(this).removeClass('datatablerowhighlight');
}
else {
clientListTable.$('tr.datatablerowhighlight').removeClass('datatablerowhighlight');
$(this).addClass('datatablerowhighlight');
}
});
},
"aoColumns": [
{ "sTitle": "#", "mData": "index", "sClass": "center" },
{ "sTitle": "Client Name", "sortable":true ,"mData": "clientName", "sClass": "left" ,"fnRender": function(obj) {
var clientName = obj.aData.clientName;
var clientId = obj.aData.clientId;
var index= obj.aData.index;
var viewClient="";
viewClient = "<div style='cursor:pointer;width:125px;' class='ellipsis'><u onclick='javascript:showClientInfo(\""+clientId+"\" ,\""+clientName+ "\" , \""+index+"\",this);'>"+ clientName +" </u></div>";
return viewClient;
} },
{ "sTitle": "Business Type", "mData": "businessType", "sClass": "left" ,"fnRender": function(obj) {
var businessType = obj.aData.businessType;
return "<div style='width:150px;' class='ellipsis'>"+ businessType +"</div>"
} }
]
} );
}