Search working

This commit is contained in:
Hein
2025-10-30 10:20:25 +02:00
parent bd47e9d0ab
commit 0943ffc483
3 changed files with 32 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ export const GridlerGoAPIExampleEventlog = () => {
const [apiKey, setApiKey] = useLocalStorage({ defaultValue: '', key: 'apikey' });
const [selectRow, setSelectRow] = useState<string | undefined>('');
const [values, setValues] = useState<Array<Record<string, any>>>([]);
const [search, setSearch] = useState<string>('');
const [sections, setSections] = useState<Record<string, unknown> | undefined>(undefined);
const columns: GridlerColumns = [
{
@@ -110,6 +111,7 @@ export const GridlerGoAPIExampleEventlog = () => {
}}
ref={ref}
scrollToRowKey={selectRow ? parseInt(selectRow, 10) : undefined}
searchStr={search}
sections={{ ...sections, rightElementDisabled: false }}
selectFirstRowOnMount={true}
selectMode="row"
@@ -131,6 +133,13 @@ export const GridlerGoAPIExampleEventlog = () => {
</Gridler>
<Divider />
<Group>
<TextInput
leftSection={<>S</>}
onChange={(e) => setSearch(e.target.value)}
placeholder="Search"
value={search}
w="190px"
/>
<TextInput
onChange={(e) => setSelectRow(e.target.value)}
placeholder="row"