Dear support,
I tried to add validators in my schedluer dialog as shown here:
https://ej2.syncfusion.com/vue/demos/#/material/schedule/editor-validation.html
However, when I submit the dialog with empty fields, it does not show any errors. (this is in my SchedulteTemplate.vue, which uses the EditorTemplate.vue)
In your example, I don't understand how it can work without anu FormValidator import?
What I would like to do is :
- Add validators on theses fields of my code :
datetimepickerstart, datetimepickers end (and also check that the date format is correct), description
- Customize the error message in french
For datetimepickerstart, datetimepickers : "La date est obligatoire"
For description " La Description est obligatoire".
Would it be possible to have an online example ?
And I have 3 more questions :
1/ How can I customize the headerTemplate dialog when I create an event ? (Juste create, it works when I edit).
2/ How can I set the datepickets in french date format ? I add the culture "fr" in my ScheduleTemplate.vue, but I guess I missed something.
The dialog template file is : EditorTemplate.vue
3/ When I select the EndTime date in my EditorTemplate.vue, it does not work : my date is not saved. Instead, this is the initial EndDate of the slot that in saved.
For instance, the endDate was "Tue Jul 20 2021 16:00:00 GMT+0200", I changed it for "
Tue Jul 20 2021 18:00:00 GMT+0200", but it saved the first, not mine.
Here is my code. Thank you very much for your help !
eventSettings: {
dataSource: extend([], scheduleData, null, true),
fields: {
subject: { name: 'Subject', validation: { required: true } },
location: {
name: 'Location',
validation: {
required: true,
regex: ['^[a-zA-Z0-9- ]*$', 'Special character(s) not allowed in this field']
}
},
description: {
name: 'Description',
validation: { required: [true, "La Description est obligatoire"] }
},
startTime: { name: 'StartTime', validation: { required: [true, "La date est obligatoire"] } },
endTime: { name: 'EndTime', validation: { required: [true, "La date est obligatoire"] } }
}
} |