Item does not update automatically
Item does not update automatically
klermann
Posts: 277Questions: 67Answers: 1
Hello Allan, I am having a problem when I create an item in the datatable, the item is sent to the server normally and created, but it is not updated in the table normally, having to refresh the page to update the item, where is the error in that situation?
login: klermann@hotmail.com
pass: 12345
ec2-34-227-195-94.compute-1.amazonaws.com:8080/financeiro/despesas/
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I went to the link provided but not sure what steps to recreate the problem. The Editor is expecting the server to send back the created row, like this request/response in the docs:
https://editor.datatables.net/manual/server#Create
What is your server script returning?
Kevin
Hi,
Could you try adding
rowId: 'id'
to your DataTables configuration inconfigDespesas.js
please?Allan
This is returning the json of the item that is created or edited, just a single item!
Hello Allan, there was no change with the addition of the rowId: "id"
Ah - I've got it this time. The problem is indeed in the data that is being returned - Editor expects
data
to be an array of row objects. Currently you just have an object:It should be:
Allan