How to manually add/delete row without AJAX request
How to manually add/delete row without AJAX request
Hi,
I have the DT (with AJAX) and Editor but want to add and remove row without AJAX request. What is the elegant way to do that?
- Should I use DT add rows example?
- Does standalone adding/deleting row for DT without Editor (through row.add() and row().remove() API methods) break the internal Editor structure?
- Is this possible for DT (ajax option) and DT (server side processing)?
The use case for this:
I show one-to-many tables relation on one table using RowsGroup plugin. Like OUTER JOIN I need to show empty fields for records that don't has any child records in another table. Also while creating and deleting new child records I need to remove/add row with empty fields for child record.
This question has an accepted answers - jump to answer
Answers
You can certainly use the DataTables API for this -
row.add()
androw().remove()
- that is what Editor uses itself. However, these are client-side only - they won't have any effect on the server. You'd need to make the Ajax call to tell the server what the updates you are making are.Allan