Add row with modal
Add row with modal
Hello,
I want, from an empty table, when i click on a button (add row), it open a modal where i can select my values for all my columns and there is a "confirm" button in the modal to add the row the table (like the edit button with editor but there it add the row).
i have seen those exemples : https://datatables.net/examples/api/add_row.html / https://editor.datatables.net/examples/inline-editing/fullRowCreate.html
but it's not exactly what i want to do (no modal), can you help me with that ?
thank in advance for you time / help
Answers
Possibly use jQuery val() to get the values. Use that result with
row.add()
to add the row to the Datatable. The data structure from the form needs to match the data structure that Datatables is initialized with.If you still need help please build a simple example with your form and a Datatable containing sample data with your data structure.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin