Adding a New Data Piece Kills Table

Adding a New Data Piece Kills Table

zgoforthzgoforth Posts: 493Questions: 98Answers: 2

Link to test case: https://jsfiddle.net/BeerusDev/3smz8gao/19/

I have attached my test case above. I have made sure the # of columns in the JS matches the number of columns in my HTML. When I comment out the "Rank" key and value, I get the error DataTables warning: table id=myTable - Requested unknown parameter 'Rank' for row 0, column 2. For more information about this error, please see http://datatables.net/tn/4.

I know what this error is and it is not the issue I am facing. When I uncomment the "Rank" key and value, the table populates nothing but their are no errors. I am having the same issue in my dynamic version I have implemented on SP, and cannot figure out why the table doesn't like it.

Answers

  • zgoforthzgoforth Posts: 493Questions: 98Answers: 2

    Here is the example with the Rank column specified in the HTML table as well as the column initialization in the JS Tab. https://jsfiddle.net/BeerusDev/3smz8gao/24/. None of the items (only one should post) post to the table and it is empty. Why is this?

  • desperadodesperado Posts: 159Questions: 33Answers: 4

    I think the problem is your filter. If I remove your comments on Rank and then run I see the "No matching records found" but if I use the datepicker to select Jan 3 I get 1 row of data.

  • desperadodesperado Posts: 159Questions: 33Answers: 4
    edited January 2022

    If I comment out your search code it displays the full table.

    I commented out the section starting with
    $.fn.dataTable.ext.search.push(

    Seen here https://jsfiddle.net/gouldner/jbpygcva/

  • kthorngrenkthorngren Posts: 20,247Questions: 26Answers: 4,760
    edited January 2022

    Requested unknown parameter 'Rank' for row 0, column 2.

    You are getting this error because the row data doesn't have the Rank property. You can use defaultContent to define what the column will contain if the property is not available. This will eliminate the error.

    As desparado mentioned your search plugin is filtering out all the rows.

    Kevin

Sign In or Register to comment.