I need to add an editable column in my table. Here is how I am creating the table currently. The data is coming from a Javascript array, and is changing (which is why I have 'destroy: true' in the table definition). I want the QTY column to have a default of 1, but to allow the user to enter their own number - and then I need to be able to retrieve that value when the form is submitted.
var table2 = $('#example').DataTable( {
select: false,
data: addedRows,
destroy: true,
columns: [
{ title: "ID" },
{ title: "Name" },
{ title: "Position" },
{ title: "Office" },
{ title: "Extn." },
{ title: "Start date" },
{ title: "Salary" },
{ title: "QTY" }
],
"columnDefs": [{
className: "ID",
"targets":[0],
"visible": false,
"searchable":false
}],
"language": {
"emptyTable": "Select items from the table above"
}
});
Can anyone help me out? Both with creating an editable column, and with getting that data upon submission?
Thanks