const ApptEditorTemplate = props => {
let recObject;
if (props) {
return (
<table className="custom-event-editor" style={{ width: "100%" }}>
<tbody>
<tr>
<td className="e-textlabel">Start time</td>
<td colSpan={4}>
<DateTimePickerComponent id="StartTime" format="dd/MM/yy hh:mm a" data-name="StartTime" value={new Date(props.startTime || props.StartTime)} className="e-field"/>
</td>
</tr>
<tr>
<td className="e-textlabel">End time</td>
<td colSpan={4}>
<DateTimePickerComponent id="EndTime" format="dd/MM/yy hh:mm a" data-name="EndTime" value={new Date(props.endTime || props.EndTime)} className="e-field"/>
</td>
</tr>
<tr>
<td className="e-textlabel">Repeat type</td>
<td colSpan={4}>
<RecurrenceEditorComponent id="RecurrenceEditor" className="e-field" data-name="RecurrenceRule" ref={t => (recObject = t)}/>
</td>
</tr>
</tbody>
</table>
);
} else {
return null;
}
}; |
I still get no RecurrenceRule data.
Hi Matthew,
You can set the recurrence editor rule value to the appointment with help of the popupClose event of the Schedule.
Sample: https://stackblitz.com/edit/ej2-react-schedule-editor-template-recurrence?file=index.js
[index.js]
const Schedule = () => { let recObject;
const onPopupClose = (args) => { if (args.type === 'Editor' && args.data) { args.data.RecurrenceRule = recObject.value; } }
const editorTempalte = props => { if (props) { return ( <table className="custom-event-editor" style={{ width: "100%" }}> <tbody> {((!props.RecurrenceID) ? <tr> <td className="e-textlabel">Repeat type</td> <td colSpan={4}> <RecurrenceEditorComponent id="RecurrenceEditor" className="e-field" data-name="RecurrenceRule" ref={t => (recObject = t)} value={props.RecurrenceRule} /> </td> </tr> : <tr></tr> )} </tbody> </table> ); } else { return null; } };
return ( <ScheduleComponent currentView="Month" editorTemplate={event => editorTempalte(event)} popupClose={onPopupClose.bind(this)}> </ScheduleComponent> ); }; |
Regards,
Ravikumar Venkatesan