row appending properly and gonig to last page

This commit is contained in:
Hash Borgir 2023-06-13 13:42:32 -06:00
parent 5a8bac8e87
commit 3ce842b52d

View File

@ -239,7 +239,7 @@ foreach (glob($tbl . "*.tbl") as $filename) {
'<td><textarea class="form-control">' + string + '</textarea></td>' +
'<td><div>' +
'<a href="#" class="update-link btn btn-primary" data-rowid="' + rowid + '">Update</a>' +
'<a href="#" class="delete-link btn btn-danger" data-rowid="' + rowid + '">Delete</a>' +
'<a style="float:right" href="#" class="delete-link btn btn-danger" data-rowid="' + rowid + '">Delete</a>' +
'</div></td>' +
'</tr>';
;
@ -250,7 +250,11 @@ foreach (glob($tbl . "*.tbl") as $filename) {
$('.table tbody').append(newRow);
$('.table').DataTable();
// Initialize DataTables on the table
var table = $('.table').DataTable();
// Go to the last page after loading the table
table.page('last').draw('page');
});
});