You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a user is added I call useRefresh() to update the list, but useRefresh() refreshes everything instead of only the users List.
Some simplified code to demonstrate what I mean:
constMachineEdit=(props)=>{const[showAddUserDialog,setShowAddUserDialog]=useState(false);return(<Edit{...props}undoable={false}><TabbedForm{...props}><FormTablabel="Machine">
...
</FormTab><FormTablabel="Users"><AddUserDialogopen={showAddUserDialog}onClose={()=>{setShowAddUserDialog(false)}}onSuccess={()=>{setShowAddUserDialog(false)// <<<<<<<<<< here i would like to trigger the list below to update}}machineId={props.id}/><Buttonsize="small"label="Toevoegen"onClick={()=>{setShowAddUserDialog(true);}}><AddIcon/></Button><List{...props}style={{width: '100%'}}resource="machine-users"filter={{machineId: props.id}}actions={<UserListActionsprops={props}machineId={props.id}/>}><DatagridrowClick="edit"><TextFieldsource="id"/><ReferenceFieldreference="users"source="userId"target="id"><TextFieldsource="email"/></ReferenceField></Datagrid></List></FormTab></TabbedForm></Edit>)}
The text was updated successfully, but these errors were encountered:
Bossieh
changed the title
Update list programmatically
Feature request: Update list programmatically
May 31, 2021
I would love a way to programmatically update a specific list.
On my "Edit machine" page I have multiple tabs, a couple tabs have a List component with related records.
On one tab I have added a button to add a user via a Dialog so the user can stay on the same page, I used this article as inspiration: https://marmelab.com/react-admin/AdvancedTutorials.html#custom-forms-and-ui-for-related-records
After a user is added I call useRefresh() to update the list, but useRefresh() refreshes everything instead of only the users List.
Some simplified code to demonstrate what I mean:
The text was updated successfully, but these errors were encountered: