Edit cells with a modal / Display all data on a row
Edit cells with a modal / Display all data on a row

Hello Members,
I have two issues that I would know if it is possible so do:
When I press a row I would like to get a modal open with input fields so I can update two specific columns. Is it possible? I know there names but not where in the table they are placed (which column)
See link: http://live.datatables.net/upgrade/2071/editWhen I press a row I would like to get up a modal that display all items on the row, dynamic. I do not know how many columns and there names.
/Jeff
This question has an accepted answers - jump to answer
Answers
You can use
table.row(this).data()
, like you have commented out, to get the row data. You can usecolumns().header()
to get theth
for each column. Use a loop to access each data element andth
element to build the fields for your form. When the form is submitted you can userow().data()
to update the row in the client. You will need to use a jquery ajax() request to perform server updates.Another option is to use the Editor to handle the form and editing processes.
Kevin
Hello Kevin,
Thanks for taking the time! Can I get the number of columns in the table? The table is dynamic.
Jeff
I would like to loop over every column even the hidden columns and display the values.
Use
columns()
withcount()
like this:Use
columns().every()
for this.Kevin
Great support Kevin!!