lucidAuth/public/misc/script.manage.js
Danny Bessems 1548cd4bb6 Managementinterface retrieves data from database;
Table on interface is editable; replaced library.
2019-03-04 10:43:08 +01:00

13 lines
661 B
JavaScript

$(document).ready(function(){
// Initialize the editable-table functionality
$('#usertable').editableTableWidget();
$('#btnnewuser').click(function() {
var newUser = 'User' + String(Math.floor(Math.random() * Math.floor(9999))).padStart(4, '0');
$('#usertable tbody').append($('<tr><td>' + newUser + '</td><td>User</td><td class="immutable"><a href="?">0</a></td></tr>'));
// Call `editableTableWidget()` again to include the newly added `<tr>`
// To prevent recreating multiple new editors; reference the already existing `<input>`
$('#usertable').editableTableWidget({editor: $('#editor')});
});
});