unable to get simpleform data on save button click
ravi-pandit14 opened this issue · comments
ravi-pandit14 commented
Description: I am configured react-admin in my react web app. I want to invite user with email but not getting 'email' and 'role' field in console.
Issue: I am unable to get simpleform data on save button click. I have create custom toolbar in simpleform and only get privious data.
My code
const UserCreate = (props) => (
<Create title="Invite" {...props} >
<SimpleForm toolbar={<EditFormToolbar />}>
<TextInput source="email" />
<SelectInput source="role" choices={constants.role_choices} optionText="role_name" optionValue="id" />
</SimpleForm>
</Create>
);
const inviteUser = (props) => {
console.log("inviteUser props:", props)
}
const FormToolbar = (props) =>
(
<Toolbar {...props} >
<SaveButton
label="Invite"
redirect={false}
// handleSubmit={handleSubmit}
// submitOnEnter={true}
handleSubmitWithRedirect={() => inviteUser(props)}
/>
</Toolbar>
);
const EditFormToolbar = compose(
withFirebase,
)(FormToolbar);
export default withFirebase(UserCreate);
export { EditFormToolbar }