This commit is contained in:
@@ -7,6 +7,7 @@ export type DataTableColumn<T> = {
|
||||
header: string;
|
||||
className?: string;
|
||||
width?: number;
|
||||
flexible?: boolean;
|
||||
cell: (row: T) => ReactNode;
|
||||
};
|
||||
|
||||
@@ -99,7 +100,10 @@ export function DataTableCard<T>({
|
||||
const totalPages = Math.max(1, Math.ceil(totalCount / pageSize));
|
||||
const currentPage = Math.min(serverPagination?.page ?? page, totalPages);
|
||||
const pageRows = serverMode ? rows : filteredRows.slice((currentPage - 1) * pageSize, currentPage * pageSize);
|
||||
const flexibleColumnIndex = columns[0]?.key === 'no' && columns.length > 1 ? 1 : -1;
|
||||
const configuredFlexibleColumnIndex = columns.findIndex((column) => column.flexible);
|
||||
const flexibleColumnIndex = configuredFlexibleColumnIndex >= 0
|
||||
? configuredFlexibleColumnIndex
|
||||
: columns[0]?.key === 'no' && columns.length > 1 ? 1 : -1;
|
||||
|
||||
const updateFilter = (key: string, value: string) => {
|
||||
if (serverPagination?.onFilterChange) {
|
||||
|
||||
Reference in New Issue
Block a user