mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
l2: refresh the type column when a row is reused
The paint loop reuses existing rows and rewrites port, MAC, VLAN and the delete button, but never the type cell - only the insert path set it. With a fixed row order that stayed invisible, since a row usually landed back where it was. Sorting moves rows, so every other column followed the data while type kept the previous row's value, which made sorting by type look broken when the sort itself was correct.
This commit is contained in:
@@ -131,6 +131,7 @@ function paintL2(tbl, s)
|
|||||||
tbl.rows[i+1].cells[0].innerHTML = `${e.port}`;
|
tbl.rows[i+1].cells[0].innerHTML = `${e.port}`;
|
||||||
tbl.rows[i+1].cells[1].innerHTML = `${e.mac}`;
|
tbl.rows[i+1].cells[1].innerHTML = `${e.mac}`;
|
||||||
tbl.rows[i+1].cells[2].innerHTML = `${e.vlan}`;
|
tbl.rows[i+1].cells[2].innerHTML = `${e.vlan}`;
|
||||||
|
tbl.rows[i+1].cells[3].innerHTML = `${e.type}`;
|
||||||
tbl.rows[i+1].cells[4].innerHTML = '<button type="button" onclick="delL2(' + e.idx + ');">' + t('l2_delete') + '</button>';
|
tbl.rows[i+1].cells[4].innerHTML = '<button type="button" onclick="delL2(' + e.idx + ');">' + t('l2_delete') + '</button>';
|
||||||
} else {
|
} else {
|
||||||
const tr = tbl.insertRow();
|
const tr = tbl.insertRow();
|
||||||
|
|||||||
Reference in New Issue
Block a user