From 211b5dbdda47c4bb19f3ebc274253b21e1b81bc4 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 8 Dec 2025 01:46:14 +0900
Subject: (김준회) 서버사이드 페칭 예시 소팅 오류 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/client-table-v2/client-table-preset.tsx | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'components/client-table-v2/client-table-preset.tsx')

diff --git a/components/client-table-v2/client-table-preset.tsx b/components/client-table-v2/client-table-preset.tsx
index 64930e7a..21486c9b 100644
--- a/components/client-table-v2/client-table-preset.tsx
+++ b/components/client-table-v2/client-table-preset.tsx
@@ -108,6 +108,9 @@ export function ClientTablePreset<TData>({
     if (s.columnOrder) table.setColumnOrder(s.columnOrder);
     if (s.grouping) table.setGrouping(s.grouping);
     if (s.pagination?.pageSize) table.setPageSize(s.pagination.pageSize);
+    // Reset page index to avoid loading an out-of-range page after applying a preset,
+    // which is especially important in server-mode pagination.
+    table.setPageIndex(0);
     
     toast.success(`Preset "${preset.name}" loaded`);
   };
-- 
cgit v1.2.3

