Fixed index column value

Fixed index column value

vikas415vikas415 Posts: 8Questions: 0Answers: 0
edited October 2010 in General
Hi,

Please help me...

In my table data records are coming dynamically and in this table first column is a fixed index column whose value is also coming dynamically.. means auto numbering from a loop.

But it is not showing correctly...means if I have 20 records then on the first page it is showing 1 to 10 but when i click on the 2 page option at bottom panel of the pagination... it is again showing 1 to 10...it should show 11 to 20 number....

here is the code:




SNo.
Task Name
Start Date
End Date
Owner
% Complete
Action




Loading data from server




///////////////////////


$(document).ready(function() {
$('#example').dataTable( {
"sScrollY": 200,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "includes/server_processing.php?section=task&mode=<?php echo $refer; ?>&typeofAccess=<?php echo $type_of_access; ?>"

} );
} );





Please help me...I'm in big trouble.


Thnaks in advance

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I presume that the SNo. column is simply a counter on the server-side. If so, you can add $_POST['iDisplayStart'] to the counter to offset it from the page start point, and have your counter continue as expected.

    Allan
  • vikas415vikas415 Posts: 8Questions: 0Answers: 0
    edited October 2010
    Hey Allan,

    Your trick is working....and problem is solve now...

    I just put a following code inside loop structure according to your suggestion.


    [code]
    $startPoint=$_GET['iDisplayStart'];
    $counter=($startPoint) + ($j);
    $sOutput .= '"'.str_replace('"', '\"', $counter).'",';
    [/code]

    and that's it...


    Thank you very much allan..:)


    Vikas
This discussion has been closed.