A few fixes

This commit is contained in:
Hein
2025-10-30 13:04:13 +02:00
parent 1284f46aa9
commit abf9433c10
8 changed files with 63 additions and 11 deletions

View File

@@ -160,10 +160,11 @@ export interface GridlerState {
getState: <K extends keyof GridlerStoreState>(key: K) => GridlerStoreState[K];
hasLocalData: boolean;
isEmpty: boolean;
loadingData?: boolean;
loadPage: (page: number, clearMode?: 'all' | 'page') => Promise<void>;
mounted: boolean;
onCellActivated: (cell: Item) => void;
onCellClicked: (cell: Item, event: CellClickedEventArgs) => void;
onCellEdited: (cell: Item, newVal: EditableGridCell) => void;
onColumnMoved: (from: number, to: number) => void;
@@ -400,7 +401,7 @@ const { Provider, useStore: useGridlerStore } = createSyncStore<GridlerStoreStat
);
})
.catch((e) => {
console.warn('loadPage Error: ', page, e);
console.error('loadPage Error: ', page, e);
state._events.dispatchEvent(
new CustomEvent('loadPage_error', {
detail: { clearMode, error: e, page: pPage, state },
@@ -411,6 +412,17 @@ const { Provider, useStore: useGridlerStore } = createSyncStore<GridlerStoreStat
},
maxConcurrency: 1,
mounted: false,
onCellActivated: (cell: Item): void => {
const state = get();
const [col, row] = cell;
state._events.dispatchEvent(
new CustomEvent('onCellActivated', {
detail: { cell, col, row, state },
})
);
state.glideProps?.onCellActivated?.(cell);
},
onCellClicked: (cell: Item, event: CellClickedEventArgs) => {
const state = get();
const [col, row] = cell;