如何在当前页面中插入行在首先或结束当前页面无关紧要
orderDetailsTable = $("#orderDetailsTable").DataTable({...});
with datatable orderDetailsTable.row.add({
"rowNum": '',
"orderDetailsId": '',
"productName": '',
"productUnit": '',
"quantity": '',
"unitPrice": '',
"total": '',
"actions": '',
}).draw(false);
orderDetailsTable.order([1, 'asc']).draw();
orderDetailsTable.page(orderDetailsTable.page()).draw(false);
此代码在结尾页面添加行...
答案 0 :(得分:0)
var line = '<tr><td>Some content</td></tr>'; //put the row content in variale
$('#my_table>tbody').append(line); // And append this variale (your new row) to the table body.