Submitting a whole table
Submitting a whole table
TLDR: can I submit a whole table to an ajax call.
hey guys, so I'm working on a web app where someone can upload an excel sheet, my backend does some processing and then creates a data table based on the formatted JSON from the excel sheet... I got all that working just fine.
I still haven't submitted any data to the database yet because I want to give the user one last chance to edit/rearrange the table.
so is it possible to have a button at the top of the table that submits the whole table with AJAX?
This question has an accepted answers - jump to answer
Answers
Yep, you can use the Buttons to create the button, and a call to
rows().data()
will get all the data, probably withrows().data().toArray()
which you can then send to your server.It might also be worth looking at Editor, as that editing and connection to the server is built-in, and it can easily to file upload.
Colin
i will give the rows().data() a shot. sadly the file upload doesn't really work for me in this instance.
Editor supports file uploading, please see example here, so it would definitely be worth considering that as a solution,
Colin