Compare commits
1 Commits
b5df954322
...
1548cd4bb6
Author | SHA1 | Date | |
---|---|---|---|
1548cd4bb6 |
@ -126,6 +126,6 @@ $.fn.editableTableWidget.defaultOptions = {
|
|||||||
cloneProperties: ['padding', 'padding-top', 'padding-bottom', 'padding-left', 'padding-right',
|
cloneProperties: ['padding', 'padding-top', 'padding-bottom', 'padding-left', 'padding-right',
|
||||||
'text-align', 'font', 'font-size', 'font-family', 'font-weight',
|
'text-align', 'font', 'font-size', 'font-family', 'font-weight',
|
||||||
'border', 'border-top', 'border-bottom', 'border-left', 'border-right'],
|
'border', 'border-top', 'border-bottom', 'border-left', 'border-right'],
|
||||||
editor: $('<input>')
|
editor: $('<input id="editor">')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
// Initialize the editable-table functionality
|
||||||
$('#usertable').editableTableWidget();
|
$('#usertable').editableTableWidget();
|
||||||
|
|
||||||
$('#btnnewuser').click(function() {
|
$('#btnnewuser').click(function() {
|
||||||
$('#usertable tbody').append($('<tr><td><username></td><td>User</td><td class="immutable"><a href="?">0</a></td></tr>'));
|
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')});
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user