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:
This is a part of my php file responsible for the output:
I think the problem is in the php file - specifically int the row: $row[]=''; Maybe this line override "counters". But when i remove this row, then it's a problem with total number of columns and data don't display.
Sorry for my english
Thanks for help
Greetings
Tom
This is my js file:
<script type="text/javascript" charset="utf-8"> $(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']] } ); } ); </script>
This is a part of my php file responsible for the output:
/* * 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<count($aColumns) ; $i++ ) { if ( $aColumns[$i] == "version" ) { /* Special output formatting for 'version' column */ $row[] = ($aRow[ $aColumns[$i] ]=="0") ? '-' : $aRow[ $aColumns[$i] ]; } else if ( $aColumns[$i] != ' ' ) { /* General output */ $row[] = $aRow[ $aColumns[$i] ]; } } $output['aaData'][] = $row; } echo json_encode( $output );
I think the problem is in the php file - specifically int the row: $row[]=''; Maybe this line override "counters". But when i remove this row, then it's a problem with total number of columns and data don't display.
Sorry for my english
Thanks for help
Greetings
Tom