connect PolicyTable key to store
This commit is contained in:
parent
c20a8b6cc7
commit
14403cc851
@ -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}
|
||||
|
||||
@ -62,7 +62,7 @@ export default class PolicyStore {
|
||||
};
|
||||
|
||||
public resetSelectedKey = () => {
|
||||
this.selectedKey = null;
|
||||
if (this.setSelectedKey !== null) this.selectedKey = null;
|
||||
};
|
||||
|
||||
public get getSelectedRow() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user