Unknown parameter on large table

Unknown parameter on large table

CheckiumCheckium Posts: 6Questions: 2Answers: 0

I have a large table (8496 rows) and I'm getting the error:
"DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter '1' for row ***. For more information about this error, please see http://datatables.net/tn/4"
The error seems to happen randomly across the table every time I reload the page.

Thats where the db is on if you want to check it: https://vhack.olympiccode.ga/database/

This question has an accepted answers - jump to answer

Answers

  • jr42.gordonjr42.gordon Posts: 305Questions: 2Answers: 49
    1. How is data being loaded into the table? I see "data : data" in your DT config, but that is throwing js error of "var data is not defined".
    2. If data is being added via js, array of values or array of objects?

    This error can mean many things: data incompatibility based on column type, too few elements in data row compared to thead columns, etc.

  • CheckiumCheckium Posts: 6Questions: 2Answers: 0

    @jr42.gordon The data is loaded on the HTML using PHP and MySQL, it loops trougth mysql rows and adds the data.

  • allanallan Posts: 63,871Questions: 1Answers: 10,525 Site admin

    Very very odd. I don't immediately see the issue I'm afraid. DataTables is reading the data in the last row as null after column 2 for some reason.

    Could you try adding a new line (\n) after each closing <tr> please?

    Allan

  • CheckiumCheckium Posts: 6Questions: 2Answers: 0
    edited March 2017

    @jr42.gordon The error seems to be totally random, nothing in the data specifies the error, theres nothing unique in the errors.Also, the error seems to happen around 300 in chrome, but only around 1000 or somethings 3000 in firefox, it only happens in some refreshes also, so it may be a rendering error

  • CheckiumCheckium Posts: 6Questions: 2Answers: 0

    @allan That didn't fix, also nothing seem to be null in the db

  • jr42.gordonjr42.gordon Posts: 305Questions: 2Answers: 49
    Answer ✓

    @Checkium I don't have experience with PHP and MySQL. Why not use the ajax option in DT config and load the data that way?
    @allan Is that possible?

  • CheckiumCheckium Posts: 6Questions: 2Answers: 0

    @jr42.gordon How does ajax work? Any example? I never used it.

  • allanallan Posts: 63,871Questions: 1Answers: 10,525 Site admin

    @allan Is that possible?

    Certainly in older browsers there were some issues with performance with super long single line strings like here. I don't believe there are any more - but that really was a super long single line so it was worth ruling it out.

    @Checkium - I've just loaded the page to have another look and it seems to be working absolutely fine for me now. Did you change anything?

    Allan

This discussion has been closed.