diff --git a/components/tablelist/TableList.tsx b/components/tablelist/TableList.tsx index aa91c7e..f9b4d8e 100644 --- a/components/tablelist/TableList.tsx +++ b/components/tablelist/TableList.tsx @@ -323,13 +323,14 @@ export const TableList = ({ }; useEffect(() => { try { - if (Array.isArray(column) && column?.length) { - const dateIndices = Array.isArray(column) - ? column + const col = typeof column === "function" ? column() : column; + if (Array.isArray(col) && col?.length) { + const dateIndices = Array.isArray(col) + ? col .map((e, index) => (e.type === "date" ? index : -1)) .filter((index) => index !== -1) : []; - const result: FieldFilterProps[] = column + const result: FieldFilterProps[] = col .filter( (e, index) => e.filter !== false && @@ -362,6 +363,7 @@ export const TableList = ({ pagination: e?.pagination, search: e?.search, })); + console.log({ result }); local.fieldFilter = result; local.render(); }