Add rows based on cell values
Add rows based on cell values

Hi everybody,
I am trying to add multiple rows at once when i click a button,based on specific rendered-computed cell values.
The columns that will have new values in the added rows will be only 2,the 'Year' and the 'max_days'.
The new 'year' will be the current Year for all added rows while the 'max_days' will be the value of the computed column 'days_left'.All the other columns will be fixed.
Do i need Editor for this?
Thank you
This discussion has been closed.
Replies
Editor is an optional extension, but it does speed up development if you're updating to a database. If you're just adding the rows in the local table, and you don't want the data updated in a remote database, then you wouldn't need Editor.
Colin
Yes,the data in this datatable comes from only 1 table in Sql Server.
I thought that only with Editor i can update-insert in db.
How can i achieve this?
You can use
create()
to create rows through the API - something like this example here.Colin
What is the difference if i use the rows.add() ?
rows.add()
is specific to Datatables (no Editor functionality) and only adds rows to the HTML table in the client. To update a database you will need to use an Ajax request to the server with the rows to add.Kevin
thank you