Add and edit options
Add and edit options
snooze
Posts: 2Questions: 1Answers: 0
I am beginner and I am looking for adding "add new" row option with inline editing for already fetched data with submit and cancel options and I cannot use the licensed editor version .
How can I go about it?
Answers
Editor offers inline creation as shown in this example.
If you can't use Editor for licensing / purchasing reasons, you would need to write the code to perform the actions you require. Needless to say, Editor is our commercial software and is what makes continued DataTables development possible - it is our solution for the issue you are looking to solve.
Allan
cant we use row.add() and render to do the same .
You can create a table similar to this example with inputs. The example shows how to keep the table in order when the inputs are changed. You will need to add code to get the changes to save to the server. You can use things like
cell().data()
orrow().data()
to get the data then push to the server via ajax.You cn use
row.add()
to add an empty row that can then be edited. You can usecolumns.render
to render the appropriate inputs.The difficult part, which Editor does very nicely, is to keep the client and server data updated and synchronized.
Kevin
Also Editor provides the UI at the front end. If you have a form that has the data you want to add to the DataTable, then yes, absolutely,
row.add()
is the method to use.Allan