index column

index column

Andreas S.Andreas S. Posts: 207Questions: 73Answers: 4

I have include the index column code about this example: https://datatables.net/examples/api/counter_columns.html

If I load the Page the first time, the column index are shown correct. to go to the next page the column index are shown
[object OBJECT]. to go forward or back to the first page the column index did show this object. I have no idea where my problem is. Should I do this on the Server side?

Here the debug Link: debug.datatables.net/iqiriv

Andreas

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Answer ✓

    Its a client-side example that you linked to, and it uses each() to loop over all rows in the table. Therefore it is not directly applicable to server-side processing. The reason you are getting [object Object] in the output is because it isn't listening for a draw event (assuming you copied to code as is), and thus it won't be running when just changing page. As I say, it is a client-side example that.

    You'd need to listen for the draw event and then loop over the data shown, offsetting it for the current page start (page.info().).

    Allan

This discussion has been closed.