Hi, I'm using the Grid component and created my own Dialog Edit template. Now I wanted to ask, how can I catch the submit-event, since I want to validate the form fields in a certain way, and if everything is okay, the submission can be done, otherwise I want to cancel the submission.
<Grid
editSettings={{
allowEditing: true,
allowAdding: true,
allowDeleting: true,
mode: "Dialog",
template: (record: object) => {
const onSubmit = () => { // Where/how can I bind this event?
//validation == true
// submit
//else
// cancel
}
return(
<div className="ms-Grid" dir="ltr">
<div className="ms-Grid-row">
<div className="ms-Grid-col ms-sm6">
<input type="text" value={record["description"]} />
</div>
<div className="ms-Grid-col ms-sm6">
<input type="text" value={record["email"]} />
</div>
</div>
</div>
);
}
}}
[...]
/>
I want to use the buttons of the "default" footer of the Dialog. I also have two tabs inside the Dialog. Therefore, having the submit-buttons in the footer is necessary. Where/How can I bind this onSubmit event to the Submit-Button?