How 'catch' a new row after an fnPageChange (with serverside)

How 'catch' a new row after an fnPageChange (with serverside)

dazelldazell Posts: 17Questions: 0Answers: 0
edited August 2010 in General
I try to catch the class of the first row of the next page of my datatable with this code :

[code]
oTable.fnPageChange( 'next' );
next_class = $('tr:first.odd').attr('class');
[/code]

but I get the class of the first row of the odl page !
What I'm doing wrong ? any Idea ?

greetings dazell

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you are using server-side processing, then remember that the call to the server is asynchronous. So the next line will execute before the new data have been loaded. So what you need to do is to do the next line after the Ajax request is complete. One option is fnDrawCallback: http://datatables.net/usage/callbacks#fnDrawCallback

    Allan
This discussion has been closed.