Problem with disappearing 'counter' for the row number when using pagination
Problem with disappearing 'counter' for the row number when using pagination
Hello. I've got a problem with disappearing "counter" for the row number. When i click "next or previous" button in pagination, my row counter disappearings. Here is my live example: http://kartoteka.tbop.org.pl/v3/test/dt/examples/server_side/row_details.html . And here info from debugger: http://debug.datatables.net/epesag
This is my js file:
[code]
$(document).ready(function() {
oTable = $('#example').dataTable( {
"fnDrawCallback": function ( oSettings ) {
var that = this;
/* Need to redo the counters if filtered or sorted */
if ( oSettings.bSorted || oSettings.bFiltered )
{
this.$('td:first-child', {"filter":"applied"}).each( function (i) {
that.fnUpdate( i+1, this.parentNode, 0, false, false );
} );
}
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/details_col.php",
"aoColumns": [
{ "sClass": "center", "bSortable": false },
null,
null,
null,
{ "sClass": "center" },
{ "sClass": "center" }
],
"aaSorting": [[1, 'asc']]
} );
} );
[/code]
This is a part of my php file responsible for the output:
[code]
/*
* Output
*/
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
/* Add the details image at the start of the display array */
$row[]='';
for ( $i=0 ; $i
This is my js file:
[code]
$(document).ready(function() {
oTable = $('#example').dataTable( {
"fnDrawCallback": function ( oSettings ) {
var that = this;
/* Need to redo the counters if filtered or sorted */
if ( oSettings.bSorted || oSettings.bFiltered )
{
this.$('td:first-child', {"filter":"applied"}).each( function (i) {
that.fnUpdate( i+1, this.parentNode, 0, false, false );
} );
}
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/details_col.php",
"aoColumns": [
{ "sClass": "center", "bSortable": false },
null,
null,
null,
{ "sClass": "center" },
{ "sClass": "center" }
],
"aaSorting": [[1, 'asc']]
} );
} );
[/code]
This is a part of my php file responsible for the output:
[code]
/*
* Output
*/
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
/* Add the details image at the start of the display array */
$row[]='';
for ( $i=0 ; $i
This discussion has been closed.
Replies
js:
[code]
$(document).ready(function() {
oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/details_col.php"
} );
} );
[/code]
php:
[code]
$aColumns = array( 'id', 'engine', 'browser', 'platform', 'version', 'grade' );
....
....
....
/*
* Output
*/
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array()
);
$n=1;
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i
Work! A million thanks. I'm not coding in PHP but in C# and the logic was the same.