couple of bug fixes

This commit is contained in:
Chris Kruining 2024-12-19 15:54:11 +01:00
parent f6af76f0ba
commit c33e99b105
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
5 changed files with 53 additions and 45 deletions

View file

@ -32,13 +32,12 @@ const GridContext = createContext<GridContextType<any>>();
const useGrid = () => useContext(GridContext)!;
type GridProps<T extends Record<string, any>> = { class?: string, groupBy?: keyof T, columns: Column<T>[], rows: DataSet<T>, api?: (api: GridApi<T>) => any };
// type GridState<T extends Record<string, any>> = { data: DataSet<T>, columns: Column<T>[], numberOfRows: number };
export function Grid<T extends Record<string, any>>(props: GridProps<T>) {
const [table, setTable] = createSignal<TableApi<T>>();
const rows = createMemo(() => props.rows);
const columns = createMemo(() => props.columns);
const columns = createMemo(() => props.columns as TableColumn<T>[]);
const mutations = createMemo(() => rows().mutations());
const ctx: GridContextType<T> = {