Server processing: quirky assumption about columns during reordering
Server processing: quirky assumption about columns during reordering
CloudStrife
Posts: 6Questions: 0Answers: 0
I've found an issue in datatables 1.7.5 using server side processing.
In one case I modified the server to return more columns in aaData than the table has. I found that this screwed up the table by displaying the wrong data in some columns. I investigated and found that the reordering step assumes that the server isn't returning more columns than the table has. In the line that looks like this:
for ( var j=0 ; j
In one case I modified the server to return more columns in aaData than the table has. I found that this screwed up the table by displaying the wrong data in some columns. I investigated and found that the reordering step assumes that the server isn't returning more columns than the table has. In the line that looks like this:
for ( var j=0 ; j
This discussion has been closed.
Replies
Having said that, in DataTables 1.8 this idea is relaxed significantly by the new mDataProp property for columns. With this you can specify an array index or object property to use for a column, regardless of the array or object's size. Have a look at this post for more information: http://datatables.net/blog/Extended_data_source_options_with_DataTables . This effectively depreciates the concept of reordering columns for a source array since it is no longer strictly needed.
I'd encourage you to have a look at the 1.8 betas and give it a go with mDataProp as I think this will work better for you in the long run as it is "baked" into the DataTables core, rather than working around an old assumption.
Regards,
Allan