Fix rendering for custom status values (#10492)
- Improve field lookup priority
This commit is contained in:
parent
946d4358c3
commit
b370d54394
|
|
@ -194,7 +194,10 @@ export function TableStatusRenderer(
|
|||
accessor?: string
|
||||
): ((record: any) => any) | undefined {
|
||||
return (record: any) => {
|
||||
const status = resolveItem(record, accessor ?? 'status');
|
||||
const status =
|
||||
resolveItem(record, accessor ?? 'status') ??
|
||||
resolveItem(record, 'status_custom_key') ??
|
||||
resolveItem(record, 'status');
|
||||
|
||||
return (
|
||||
status && (
|
||||
|
|
|
|||
|
|
@ -368,14 +368,14 @@ export type StatusColumnProps = TableColumnProps & {
|
|||
};
|
||||
|
||||
export function StatusColumn(props: StatusColumnProps): TableColumn {
|
||||
const accessor: string = props.accessor ?? 'status';
|
||||
const accessor: string = props.accessor ?? 'status_custom_key';
|
||||
|
||||
return {
|
||||
accessor: 'status',
|
||||
sortable: true,
|
||||
switchable: true,
|
||||
minWidth: '50px',
|
||||
render: TableStatusRenderer(props.model, accessor ?? 'status_custom_key'),
|
||||
render: TableStatusRenderer(props.model, accessor),
|
||||
...props
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue