connect PolicyTable key to store

This commit is contained in:
vchikalkin 2023-05-05 16:33:40 +03:00
parent c20a8b6cc7
commit 14403cc851
2 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import { Table } from 'ui/antd';
export const PolicyTable = observer(({ getter, ...props }) => {
const { $tables } = useStore();
const { getValues, setSelectedKey } = getter($tables.elt);
const { getValues, setSelectedKey, getSelectedRow } = getter($tables.elt);
return (
<Table
@ -19,6 +19,7 @@ export const PolicyTable = observer(({ getter, ...props }) => {
onSelect: (record) => {
setSelectedKey(record.key);
},
selectedRowKeys: getSelectedRow ? [getSelectedRow.key] : [],
type: 'radio',
}}
{...props}

View File

@ -62,7 +62,7 @@ export default class PolicyStore {
};
public resetSelectedKey = () => {
this.selectedKey = null;
if (this.setSelectedKey !== null) this.selectedKey = null;
};
public get getSelectedRow() {