Bug with Index Column?
Bug with Index Column?
Rockb
Posts: 97Questions: 0Answers: 0
A curious problem: The numbers (the index column) appears on the first page, but after clicking on a different like the 2nd or the 100th page, it will change to the "real" entry for this field. Independent If I choose a blank field for generating the index column or a "real" column.
In former times I used
[code]"fnDrawCallback": function ( oSettings ) {if ( oSettings.bSorted || oSettings.bFiltered ){for ( var i=0, iLen=oSettings.aiDisplay.length ; i
In former times I used
[code]"fnDrawCallback": function ( oSettings ) {if ( oSettings.bSorted || oSettings.bFiltered ){for ( var i=0, iLen=oSettings.aiDisplay.length ; i
This discussion has been closed.
Replies
You are using server-side processing in your local use I guess? Certainly I don't see the problem you indicate on the example you link to - unless I'm really confused (I'm thinking I'm just partly confused).
In which case yes, its is due to server-side processing since the update of the indexes only operates on the client-side where the rows are. If the rows aren't present (which they aren't for other pages in SSP mode) then they can't be updated!
Allan
No, it's on a public web server. I'll send you the link.
Thanks for the link - however, as I say, the problem is that you are using server-side processing, it is not a bug in DataTables. You'd need a different solution than the one presented in my client-side code.
I'd say you have three options:
Allan
Thank you, Allan, for your answer - and every other problem solving before. I really appreciate that and I know that many benefit from your script and from all of your help. If my content will get some money by micropayment, which I am planning to do, I will donate you - that's understood.
To your suggestions: Modifying my data on the server won't help, or? For sure I can set an index column, but this doesn't make sense while ordering the columns. Or what exactly do you mean by that? Maybe you will find the time and could offer a tiny snippet to the server side examples http://www.datatables.net/examples/server_side/index.html - I think there are a lot who are using ssp AND who needs an index, or?
I've started a topic on stackoverflow, cause I'm unable to do this index column - and Allan has too much to do. Hopefully the community there will find a solution.
Sure it will - just take the start position in the data, and count from there to the end. You don't need to read the information from the database, just calculate it in the script and then dump it back to the client. For example, if you know that the first row requested by DataTables is row index 10 (which you do from the parameters sent to the server), then you want to show the row index as 11 (i.e. add one, so the user sees it counting from 1). Then for each row outputted add one.
Possibly, but its the first time I've seen this question :-). I'm sure that if you post your solution others would greatly appreciate it.
Allan
Okay, here we go :-)
In
examples/server_side/scripts/server_processing.php
(download package) change this...to...
...and for sure don't forget to add a pseudo-column to (e.g.) the first column in the same file above. For example:
AND in the table itself. That's it.
Good stuff :-)
Allan