Interesting delemma
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user