Use Duplicate button to send data to another table
Use Duplicate button to send data to another table

I was following one of the example in forum live.datatables.net/yokemanu/9/edit to copy data row from one table and send them to another table.
var data = tabletwo.row($(this).closest('tr')).data()
; selects all the row data and sends it to another table having same structure as table1.
and if the column names are not matching it show error(unknown field name)
Is there a way to only choose specific columns that I can send to another table
$('#promotions').on('click', '.duplicatetwo', function(e) {
e.preventDefault();
var data = tabletwo.row($(this).closest('tr')).data();
delete data.DT_RowId;
editor_replaced.create().set(data).submit();
});
Thank you
KT
This question has accepted answers - jump to:
Answers
You can manipulate the
data
variable any way that is needed. Thedelete data.DT_RowId;
statement is removing the unneededDT_RowId
property.Kevin
Just delete the properties you don't want to copy - like you already do with DT_RowId.
Something like this should work.
thank you
You guys are just amazing! Bless you