From d42e6f61bdc4f84c7726d04646222ed5c7b017e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96zt=C3=BCrk?= Date: Sat, 7 Feb 2026 01:44:44 +0300 Subject: [PATCH] =?UTF-8?q?Pivot=20=C3=BCzerinde=20Grafik=20g=C3=B6ster=20?= =?UTF-8?q?k=C4=B1sm=C4=B1=20se=C3=A7ilebiliyor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/list/Pivot.tsx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ui/src/views/list/Pivot.tsx b/ui/src/views/list/Pivot.tsx index 65d3948a..d7972a1b 100644 --- a/ui/src/views/list/Pivot.tsx +++ b/ui/src/views/list/Pivot.tsx @@ -41,6 +41,7 @@ import { layoutTypes } from '../admin/listForm/edit/types' import { useListFormCustomDataSource } from './useListFormCustomDataSource' import { useListFormColumns } from './useListFormColumns' import { useStoreState } from '@/store' +import Checkbox from '@/components/ui/Checkbox' interface PivotProps { listFormCode: string @@ -67,6 +68,7 @@ const Pivot = (props: PivotProps) => { const [gridDataSource, setGridDataSource] = useState>() const [columnData, setColumnData] = useState() + const [showChart, setShowChart] = useState(false) // StateStoring için storageKey'i memoize et const storageKey = useMemo(() => { @@ -282,6 +284,9 @@ const Pivot = (props: PivotProps) => { addCss(css) } } + + // Set initial chart visibility + setShowChart(gridDto.gridOptions.pivotOptionDto.showChart ?? false) }, [gridDto]) // Kolonları memoize et @@ -388,9 +393,9 @@ const Pivot = (props: PivotProps) => { } }, [gridDto, columnData, gridDataSource, customLoadState]) - // Chart binding - sadece bir kez + // Chart binding - showChart değiştiğinde de çalışmalı useEffect(() => { - if (!gridRef?.current || !chartRef?.current) return + if (!showChart || !gridRef?.current || !chartRef?.current) return const pivotInstance = gridRef?.current?.instance() const chartInstance = chartRef?.current?.instance() @@ -400,7 +405,7 @@ const Pivot = (props: PivotProps) => { alternateDataFields: false, }) } - }, [gridDto]) + }, [showChart, gridDto]) return ( <> @@ -418,6 +423,14 @@ const Pivot = (props: PivotProps) => {
+ +
- {gridDto.gridOptions.pivotOptionDto.showChart && ( + {showChart && (