我对 jQuery DataTables 很陌生。我正在寻找一个只显示数字而不是像Previous,Next等选项的分页。我试过这个,但它没有用。
$("#myCsps").dataTable({
"bFilter": false,
"bInfo": true,
"bProcessing": true,
"sPaginationType": "bootstrap",
"asStripClasses": null,
"oLanguage": {
"sInfo": "Total CSPs: _TOTAL_",
"oPaginate": {
"sNext": "",
"sLast": "",
"sFirst": null,
"sPrevious": null
}
},
//oSearch: { "sSearch": "Type here...", "bRegex": false, "bSmart": false },
"bLengthChange": false,
"aaData": data,
"aoColumns": columnSettings,
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).children().each(function(index, td) {
if (index == 7) {
if ($(td).html() === "Schedule0") {
$(td).css("background-color", "#078DC6");
} else if ($(td).html() === "Schedule1") {
$(td).css("background-color", "#FFDE00");
} else if ($(td).html() === "Schedule2") {
$(td).css("background-color", "#06B33A");
} else if ($(td).html() === "Schedule3") {
$(td).css("background-color", "#FF3229");
} else {
$(td).css("background-color", "#FF3229");
}
}
});
return nRow;
}
});