diff --git a/src/frontend/src/components/core/parameterRenderComponent/components/TableNodeComponent/index.tsx b/src/frontend/src/components/core/parameterRenderComponent/components/TableNodeComponent/index.tsx index 925ebefba..ec5925706 100644 --- a/src/frontend/src/components/core/parameterRenderComponent/components/TableNodeComponent/index.tsx +++ b/src/frontend/src/components/core/parameterRenderComponent/components/TableNodeComponent/index.tsx @@ -141,7 +141,8 @@ export default function TableNodeComponent({ const isCustomEdit = column.formatter && ((column.formatter === "text" && column.edit_mode === "modal") || - column.formatter === "json"); + column.formatter === "json" || + column.formatter === "boolean"); return { field: column.name, onUpdate: updateComponent, diff --git a/src/frontend/src/components/core/parameterRenderComponent/components/tableComponent/components/tableAutoCellRender/index.tsx b/src/frontend/src/components/core/parameterRenderComponent/components/tableComponent/components/tableAutoCellRender/index.tsx index 465b31228..16a9be4c3 100644 --- a/src/frontend/src/components/core/parameterRenderComponent/components/tableComponent/components/tableAutoCellRender/index.tsx +++ b/src/frontend/src/components/core/parameterRenderComponent/components/tableComponent/components/tableAutoCellRender/index.tsx @@ -5,6 +5,8 @@ import DateReader from "@/components/core/dateReaderComponent"; import { Badge } from "@/components/ui/badge"; import { cn, isTimeStampString } from "@/utils/utils"; import { CustomCellRendererProps } from "ag-grid-react"; +import { uniqueId } from "lodash"; +import ToggleShadComponent from "../../../toggleShadComponent"; interface CustomCellRender extends CustomCellRendererProps { formatter?: "json" | "text" | "boolean" | "number" | "undefined" | "null"; @@ -81,7 +83,18 @@ export default function TableAutoCellRender({ value === true ? true : false; - return ( + return !!colDef?.onCellValueChanged || + !!api.getGridOption("onCellValueChanged") ? ( + { + setValue?.(data.value); + }} + editNode={true} + id={"toggle" + colDef?.colId + uniqueId()} + disabled={false} + /> + ) : ( [] { }; } else if (col.formatter === FormatterType.boolean) { newCol.cellRenderer = TableAutoCellRender; - newCol.cellEditorPopup = false; - newCol.cellEditor = TableToggleCellEditor; + newCol.editable = false; newCol.autoHeight = false; newCol.cellClass = "no-border !py-2"; newCol.type = "boolean";