Interesting delemma

This commit is contained in:
Hein
2025-10-13 18:05:59 +02:00
parent 04c516f702
commit 24227f2110
5 changed files with 326 additions and 52 deletions

View File

@@ -1,5 +1,6 @@
import { Divider, Stack, TextInput } from '@mantine/core';
import { Divider, Group, Stack, TagsInput, TextInput } from '@mantine/core';
import { useLocalStorage } from '@mantine/hooks';
import { useState } from 'react';
import type { GridlerColumns } from '../components/Column';
@@ -12,7 +13,8 @@ export const GridlerGoAPIExampleEventlog = () => {
key: 'apiurl',
});
const [apiKey, setApiKey] = useLocalStorage({ defaultValue: '', key: 'apikey' });
const [selectRow, setSelectRow] = useState<string | undefined>('');
const [values, setValues] = useState<Array<Record<string, any>>>([]);
const columns: GridlerColumns = [
{
id: 'id_process',
@@ -58,10 +60,33 @@ export const GridlerGoAPIExampleEventlog = () => {
// },
];
}}
keyField="id_process"
onChange={(v) => {
console.log('GridlerGoAPIExampleEventlog onChange', v);
setValues(v);
}}
selectedRow={selectRow ? parseInt(selectRow, 10) : undefined}
uniqueid="gridtest"
values={values}
>
<APIAdaptorGoLangv2 authtoken={apiKey} url={`${apiUrl}/public/process`} />
</Gridler>
<Divider />
<Group>
<TextInput
onChange={(e) => setSelectRow(e.target.value)}
placeholder="row"
value={selectRow}
w="90px"
/>
<TagsInput
data={[]}
onChange={(str) => setValues(str.map((v) => ({ id_process: String(v) })))}
placeholder="Values"
value={values.map((v) => String(v?.id_process))}
/>
;
</Group>
</Stack>
);
};