Rank Column doesn't work with AJAX data source
Rank Column doesn't work with AJAX data source
Trying this out:
http://www.datatables.net/examples/api/counter_column.html
With DOM data source it works fine but with AJAX data source, it acts very weird.
If I have 25 total elements and display 10 by default, the first row shows rank of 25 so it reads:
25
2
3
4
5
6
7
8
9
10
But if I set default iDisplaylength to 25, then this fixes it. I put an alert message right before
[code]
alert('index is at '+i);
$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
[/code]
The initial rank numbers of my table look fine but using the alert message, when the index is at 11, it starts setting the rank of the first row to "11", then then to "12", "13", etc until it hits "25".
Very strange
http://www.datatables.net/examples/api/counter_column.html
With DOM data source it works fine but with AJAX data source, it acts very weird.
If I have 25 total elements and display 10 by default, the first row shows rank of 25 so it reads:
25
2
3
4
5
6
7
8
9
10
But if I set default iDisplaylength to 25, then this fixes it. I put an alert message right before
[code]
alert('index is at '+i);
$('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 );
[/code]
The initial rank numbers of my table look fine but using the alert message, when the index is at 11, it starts setting the rank of the first row to "11", then then to "12", "13", etc until it hits "25".
Very strange
This discussion has been closed.