mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 04:26:03 +00:00
row appending properly and gonig to last page
This commit is contained in:
parent
5a8bac8e87
commit
3ce842b52d
@ -124,15 +124,15 @@ foreach (glob($tbl . "*.tbl") as $filename) {
|
||||
// // Initialize DataTables on the table
|
||||
// $('.table').DataTable();
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
|
||||
// Function to resize textarea based on content
|
||||
// Function to resize textarea based on content
|
||||
function resizeTextarea() {
|
||||
this.style.height = 'auto';
|
||||
this.style.height = (this.scrollHeight) + 'px';
|
||||
}
|
||||
|
||||
// Select element change event handler
|
||||
// Select element change event handler
|
||||
$('#tableName').change(function () {
|
||||
$('.table').DataTable().destroy();
|
||||
$('.table tbody').html('');
|
||||
@ -170,7 +170,7 @@ foreach (glob($tbl . "*.tbl") as $filename) {
|
||||
|
||||
|
||||
|
||||
// Delete link click event handler
|
||||
// Delete link click event handler
|
||||
$(document).on('click', '.delete-link', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user