【发布时间】:2015-07-29 10:37:45
【问题描述】:
我使用以下 javascript 来获取行索引。通过使用此 ID(表头)始终以 1 开头,以防在每个页面中选择下 10 个值。我需要将下一个 10 显示为 11 到 20。非常感谢..
$(document).ready(function() {
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"ajax": "scripts/server_processing.php",
"aoColumns": [
{
"sTitle": "ID"},
{
"sTitle": "E Mail"},
{
"sTitle": "FirstName"},
{
"sTitle": "LastName"},
{
"sTitle": "Company"},
{
"sTitle": "Course"},
{
"sTitle": "Module"},
{
"sTitle": "Completions"},
{
"sTitle": "First"},
{
"sTitle": "Last",
"sClass": "center"},
{
"sTitle": "Lowest"},
{
"sTitle": "Highest",
"sClass": "center"},
// {
// "sTitle": "#"},
],
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var index = iDisplayIndex +1;
$('td:eq(1)',nRow).html(index);
return nRow;
}
});
});
【问题讨论】:
标签: javascript jquery ajax datatables