mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
web: Clean up console logs and reset active cell after edit
This commit is contained in:
@@ -407,7 +407,6 @@ const DataTable = (props: DataTableProps) => {
|
|||||||
const height = computeTableHeight(data);
|
const height = computeTableHeight(data);
|
||||||
|
|
||||||
if (tableRef.current === null) {
|
if (tableRef.current === null) {
|
||||||
console.log("new Tabulator");
|
|
||||||
tableRef.current = new Tabulator(tableContainerRef.current, {
|
tableRef.current = new Tabulator(tableContainerRef.current, {
|
||||||
layout: "fitColumns",
|
layout: "fitColumns",
|
||||||
data: data,
|
data: data,
|
||||||
@@ -426,6 +425,10 @@ const DataTable = (props: DataTableProps) => {
|
|||||||
const activeRowPosition = activeCell?.getRow().getPosition() as number;
|
const activeRowPosition = activeCell?.getRow().getPosition() as number;
|
||||||
const activeField = activeCell?.getField();
|
const activeField = activeCell?.getField();
|
||||||
|
|
||||||
|
if (activeCell) {
|
||||||
|
console.log(activeCell.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
// Update data
|
// Update data
|
||||||
tableRef.current.replaceData(newData).then(() => {});
|
tableRef.current.replaceData(newData).then(() => {});
|
||||||
|
|
||||||
@@ -472,7 +475,6 @@ const DataTable = (props: DataTableProps) => {
|
|||||||
|
|
||||||
// Set new callbacks
|
// Set new callbacks
|
||||||
tableRef.current.on("cellEditing", (cell) => {
|
tableRef.current.on("cellEditing", (cell) => {
|
||||||
console.log("cellEditing", cell);
|
|
||||||
setActiveCell(cell);
|
setActiveCell(cell);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -481,6 +483,7 @@ const DataTable = (props: DataTableProps) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tableRef.current.on("cellEdited", (cell) => {
|
tableRef.current.on("cellEdited", (cell) => {
|
||||||
|
setActiveCell(null);
|
||||||
onCellEdited(cell);
|
onCellEdited(cell);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user