fix: default checkbox for row selection type
This commit is contained in:
parent
97136c62ba
commit
53212ee47d
@ -29,6 +29,7 @@ export function SimpleTable(props: SimpleTableProps) {
|
|||||||
associatedKey,
|
associatedKey,
|
||||||
isFieldComponent,
|
isFieldComponent,
|
||||||
onSelected,
|
onSelected,
|
||||||
|
multiple = true,
|
||||||
selectedRowKeys: srk,
|
selectedRowKeys: srk,
|
||||||
} = props;
|
} = props;
|
||||||
const { rowKey = 'id', name: viewName, actionDefaultParams = {}, fields = [], rowViewName, actions = [], paginated = true, defaultPerPage = 10 } = schema;
|
const { rowKey = 'id', name: viewName, actionDefaultParams = {}, fields = [], rowViewName, actions = [], paginated = true, defaultPerPage = 10 } = schema;
|
||||||
@ -78,6 +79,7 @@ export function SimpleTable(props: SimpleTableProps) {
|
|||||||
const tableProps: any = {};
|
const tableProps: any = {};
|
||||||
if (actions.length) {
|
if (actions.length) {
|
||||||
tableProps.rowSelection = {
|
tableProps.rowSelection = {
|
||||||
|
type: multiple ? 'checkbox' : 'radio',
|
||||||
selectedRowKeys,
|
selectedRowKeys,
|
||||||
onChange,
|
onChange,
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ export function Table(props: TableProps) {
|
|||||||
associatedKey,
|
associatedKey,
|
||||||
isFieldComponent,
|
isFieldComponent,
|
||||||
onSelected,
|
onSelected,
|
||||||
multiple,
|
multiple = true,
|
||||||
selectedRowKeys: srk,
|
selectedRowKeys: srk,
|
||||||
} = props;
|
} = props;
|
||||||
const { name: viewName, fields, actionDefaultParams = {}, defaultTabName, rowKey = 'id', actions = [], paginated = true, defaultPerPage = 10 } = schema;
|
const { name: viewName, fields, actionDefaultParams = {}, defaultTabName, rowKey = 'id', actions = [], paginated = true, defaultPerPage = 10 } = schema;
|
||||||
|
Loading…
Reference in New Issue
Block a user