<th>Cost</th>
<th>Quantity</th>
<th>Total</th>
+ <th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3">Total payable:</td>
<td></td>
+ <td></td>
</tr>
</tfoot>
</table>
invoiceTitle,
invoicePrice,
1,
- null
+ null,
+ '<button class="drop"><i class="fa fa-trash"></i> Remove</button>'
]
);
}
"bSortable": false,
"bSearchable": false,
}, {
- "aTargets": [-1],
+ "aTargets": [-2],
"mRender": function ( data, type, full ) {
var price = Number.parseFloat(data).toFixed(2);
return '£'+price;
}
}));
+ $("#sale").on("click", "button.drop", function(){
+ sale_table.DataTable().row($(this).parents('tr')).remove().draw(false);
+ });
+
var items_table = $("#invoices").dataTable($.extend(true,{}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false },