suppress DataTables alert?

suppress DataTables alert?

zgoforthzgoforth Posts: 493Questions: 98Answers: 2

Link to test case: https://jsfiddle.net/BeerusDev/juy1p97h/5/

For some reason I am getting the Warning: Requested unknown parameter alert when I click "Mark Task as Completed" button. I cannot figure out why that it is doing this, as when I click that button it posts a new list item to another list that my completedTable "GETS" from. It is a field created by SharePoint so it is never null or anything and will always have a date value. I know a work around would be to create a moment value in my column render, but then that will change every day to the current date? or will it.

The main problem is that I think the table is trying to read the table before the data is sent to it, then it alerts the error, but when you click "ok" the tables both load, and the correct value of the Completion date (aka data.Created) populates to the field.

The fiddle I have created shows the format/order of my JS, maybe I am initializing or calling something in the wrong spot?

I only added the crucial JS to my fiddle, if I need to add more let me know.

This question has an accepted answers - jump to answer

Answers

  • zgoforthzgoforth Posts: 493Questions: 98Answers: 2

    Let me reword, I guess I do not want to suppress the warning as something is obviously causing it even though the table is doing what is intended.

    I just want to figure out why my #completeTaskTable is trying to read the data before it is there. I post the selRowData from the taskTable as an item to a new sharepoint list, then the completedTaskTable reads from that new list.

  • zgoforthzgoforth Posts: 493Questions: 98Answers: 2

    I re-read through the docs and found a solution that works. https://datatables.net/reference/option/columns.defaultContent

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951
    Answer ✓

    Looks like you are initializing two empty Datatables. Then fetching the data via a jQuery ajax request. In the success function you are adding the data. There isn't a way for the table to read the data before it is processed in the success function.

    Without seeing the problem happen its hard to say what the problem is. I would look at this section of the Requested unknown parameter technote. If some of the row data is missing the objects defined by columns.data then you will get this error. Pay attention to the details in the error to narrow down where to look.

    Kevin

Sign In or Register to comment.