I have a table containig data created using JqueryDataTable.
function showGrid()
{
var table = $('#example').DataTable({
stateSave: true,
rowsGroup: [// Always the array (!) of the column-selectors in specified order to which rows grouping is applied
// (column-selector could be any of specified in https://datatables.net/reference/type/column-selector)
1, 0
]
});
var currentPage = table.page();
table.page(currentPage).draw(false);
$('#example').css("display", "block");
}
I need to create a new row ina specific index. I used below code to make it.
function addRow() {
$('#example > tbody > tr').eq(3).after('<tr><td>Added Row</td><td>Accountant</td><td>Test3</td><td>Test4</td><td>Test5</td><td>Test6</td></tr>');
$("#example").trigger("update");
console.log("new row added");
}
Anew row has been added to grid as below.
The issue is, newly created row is not retainining when moving from one page to another.
Any help will be appreciated.