you can try this :
$('#yourtableid').dataTable({
fnCreatedRow: function (nRow, aData, iDataIndex) {
var rowNumber = oTableDetails.fnSettings()._iDisplayStart + (iDataIndex + 1);
$('td', nRow).first().html(rowNumber);
}
});
[quote]you can change this part [code]$('td', nRow).first().html(rowNumber);[/code] if you dont what use first()
to [code]$('td:eq(0)', nRow).html(rowNumber);[/code][/quote]
Replies
you can try this :
$('#yourtableid').dataTable({
fnCreatedRow: function (nRow, aData, iDataIndex) {
var rowNumber = oTableDetails.fnSettings()._iDisplayStart + (iDataIndex + 1);
$('td', nRow).first().html(rowNumber);
}
});
[quote]you can change this part [code]$('td', nRow).first().html(rowNumber);[/code] if you dont what use first()
to [code]$('td:eq(0)', nRow).html(rowNumber);[/code][/quote]
hope it helps :D
[code] var oTableDetails = $('#yourtableid').dataTable({
fnCreatedRow: function (nRow, aData, iDataIndex) {
var rowNumber = oTableDetails.fnSettings()._iDisplayStart + (iDataIndex + 1);
$('td', nRow).first().html(rowNumber);
}
});
[/code]