diff --git a/index.html b/index.html index 52a43a5..b24580d 100644 --- a/index.html +++ b/index.html @@ -173,9 +173,9 @@ function detectColumn(name) { return null; } -function rowId(row, idx) { +function rowId(row, idx, headers) { const katoCol = dataColumns.indexOf('kato'); - if (katoCol !== -1 && row[dataColumns[katoCol]]) return String(row[dataColumns[katoCol]]).trim(); + if (katoCol !== -1 && row[headers[katoCol]]) return String(row[headers[katoCol]]).trim(); return 'row_' + idx; } @@ -470,7 +470,7 @@ function handleFile(file) { allData = rows.map((r, idx) => { const obj = {}; headers.forEach((h, i) => { obj[h] = r[i] != null ? r[i] : ''; }); - obj._id = rowId(obj, idx); + obj._id = rowId(obj, idx, headers); return obj; }); allData.columns = headers;