Works in 1.8.2, in 1.9.0 trhows a "Requested unknown parameter '5' from the data source for row 0"

Works in 1.8.2, in 1.9.0 trhows a "Requested unknown parameter '5' from the data source for row 0"

antoniomaxantoniomax Posts: 3Questions: 0Answers: 0
edited March 2012 in General
Can't understand why.
If I'm using a 1.8.2 datatables js it works fine. Upgrading to 1.9.0 just gives this error.
Checked returned aAdata, columns, etc.
I have a debug file:
http://debug.datatables.net/amalap
What's wrong?

Replies

  • webcliqwebcliq Posts: 3Questions: 1Answers: 0
    I had the same problem. But have resolved it with new Json_encoded output array

    My PHP routine produces:

    {"sEcho":0,"iTotalRecords":32,"iTotalDisplayRecords":32,"aaData":[{"DT_RowId":"4","0":"4","1":"str(0)","2":"Login","3":"Login"},{"DT_RowId":"6","0":"6","1":"str(1)","2":"Username","3":"Username"},{"DT_RowId":"8","0":"8","1":"str(2)","2":"Password","3":"Password"},
    .......
    {"DT_RowId":"68","0":"68","1":"str(31)","2":"Link","3":"Link"}]}

    I am using Redbean so cannot use out of the box AJ PHP code.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    @antoniomax - I suspect that you might need to add "sDefaultContent": "" to your last two columns to get that working, but I'm not actually 100% sure. Could you possibly use fnServerParams rather than overriding fnServerData and then rerun the debugger so I can see what is being returned from the server exactly.

    Thanks,
    Allan
  • antoniomaxantoniomax Posts: 3Questions: 0Answers: 0
    Thank you Allan and Webcliq. Thank you both.
    @allan Your assumption was correct, adding the "sDefaultContent: null" to the last two rows got rid of that error. Thanks.
This discussion has been closed.