diff --git a/docs/List.md b/docs/List.md index c8e381cccc4..f67f341094b 100644 --- a/docs/List.md +++ b/docs/List.md @@ -1340,21 +1340,6 @@ const PostList = props => ( ) ``` -### `isRowSelectable` - -You can customize which rows will show a selection checkbox using the `isRowSelectable` prop. It expects a function that will receive the record of each `` and returns a boolean expression. For instance, this code shows a checkbox only for rows with an id greater than 300: - -```jsx -export const PostList = props => ( - - record.id > 300 }> - ... - - -); -``` -{% endraw %} - ![expandable panel](./img/datagrid_expand.gif) The `expand` prop expects an component as value. When the user chooses to expand the row, the Datagrid render the component, and passes the current `record`, `id`, and `resource`. @@ -1389,7 +1374,7 @@ const PostList = props => ( The result will be the same as in the previous snippet, except that `` encloses the content inside a material-ui ``. -**Tip**: You can go one step further and use an `` view as `expand` component, albeit with a twist: +**Tip**: You can go one step further and use an `` view as `expand` component: ```jsx const PostEdit = props => ( @@ -1398,10 +1383,7 @@ const PostEdit = props => ( /* disable the app title change when shown */ title=" " > - + @@ -1420,6 +1402,21 @@ const PostList = props => ( ) ``` +### `isRowSelectable` + +You can customize which rows will show a selection checkbox using the `isRowSelectable` prop. It expects a function that will receive the record of each `` and returns a boolean expression. For instance, this code shows a checkbox only for rows with an id greater than 300: + +```jsx +export const PostList = props => ( + + record.id > 300 }> + ... + + +); +``` +{% endraw %} + ### CSS API The `Datagrid` component accepts the usual `className` prop but you can override many class names injected to the inner components by React-admin thanks to the `classes` property (as most Material UI components, see their [documentation about it](https://material-ui.com/customization/components/#overriding-styles-with-classes)). This property accepts the following keys: diff --git a/examples/simple/src/users/UserEditEmbedded.js b/examples/simple/src/users/UserEditEmbedded.js index a7ab2290d16..7ba7a1d1478 100644 --- a/examples/simple/src/users/UserEditEmbedded.js +++ b/examples/simple/src/users/UserEditEmbedded.js @@ -6,11 +6,7 @@ import { Edit, SimpleForm, TextInput, required } from 'react-admin'; const UserEditEmbedded = ({ permissions, ...props }) => ( /* Passing " " as title disables the custom title */ - +