fix: Create table rows if they don't exist

This commit is contained in:
Paul Gauthier (aider) 2024-12-22 18:04:01 -05:00
parent e62003c0ce
commit 6230df749e

View file

@ -77,6 +77,11 @@ document.addEventListener('DOMContentLoaded', function () {
var tableBody = document.querySelector('table tbody');
allData.forEach(function(row, index) {
var tr = tableBody.children[index];
if (!tr) {
// If the row doesn't exist, create it
tr = document.createElement('tr');
tableBody.appendChild(tr);
}
tr.id = 'edit-row-' + index;
tr.style.cursor = 'pointer';
tr.onclick = function() {