準備使用代碼:只需按要求
$("#myTable1").DataTable({
"oLanguage": {
"sSearch": "Search Address:"
},
"iDisplayLength": 50,
"processing": true, // for show progress bar
"serverSide": true, // for process server side
"filter": true, // this is for disable filter (search box)
"orderMulti": false, // for disable multiple column at once
"ajax": {
"url": url,
"type": "POST",
"datatype": "json"
},
"columns": [
{ "data": "ProviderName", "name": "ProviderName", "autoWidth": true },
{ "data": "ProviderName", "name": "ProviderName", "autoWidth": true },
{ "data": "cpTitle", "name": "cpTitle", "autoWidth": true },
{ "data": "cpAddress", "name": "cpAddress", "autoWidth": true },
{ "data": "cpPriceHourly", "name": "cpPriceHourly", "autoWidth": true },
{ "data": "cpCreatedDate", "name": "cpCreatedDate", "autoWidth": true },
{ "data": "cpId", "name": "cpId", "autoWidth": true }
],
"columnDefs": [{
"targets": 0,
"data": null,
"render": function (data, type, full, meta) {
cnt++;
if (cnt != 0) {
$("#divExcel").show();
}
return meta.settings._iDisplayStart + meta.row + 1;
}
}]
});
一些代碼,將有助於理解這個問題?使用 – Vishal