Confirmation dialog for action
Some actions support confirmation dialog out of the box. For instance you can enable confirmation dialog for
DeleteButton
just by passing undoable={false}
Ā
When you need confirmation for your custom button (or any other action), you can leverage
Confirm
dialog component exported from react-admin
package.There is another example in bulkActionButtons section of RA documentation.
Make FunctionField
sortable
Technically, you can omit theĀsource
Ā andĀsortBy
Ā properties for theĀ<FunctionField>
Ā since you provide the render function. However, providing aĀsource
Ā or aĀsortBy
Ā will allow theĀDatagrid
Ā to make the column sortable, since when a user clicks on a column, theĀDatagrid
Ā uses these properties to sort. Should you provide both,ĀsortBy
Ā will overrideĀsource
Ā for sorting the column.
So without
source
it will work as it should but the list won't be sortable by status
.Display read only field in SimpleIteratorForm
<SimpleFormIterator>
Ā only acceptsĀInput
Ā components as children. If you want to use someĀFields
Ā instead, you have to use aĀ<FormDataConsumer>
Ā to get the correct source
Ā