Validation does not work in my scheduler + some problems with the datapicker in my scheduler

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 !




Attachment: code_54966ec0.zip

2 Replies

BS Balasubramanian Sattanathan Syncfusion Team August 2, 2021 03:36 PM UTC

Hi Sandra, 

Thanks for the update. 

We have validated your required scenario and let you know that our online field-validation sample have default validation rules for default fields. As we mentioned in the forum #167351, we can validate the fields by using FormValidator. Kindly refer to the below code snippet 

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"] }
      }                 

And I have 3 more questions : 

Currently we are validating the requirements at our end and will update further details on August 4, 2021. We would appreciate your patience. 

Regards, 
Balasubramanian S 



VD Vinitha Devi Murugan Syncfusion Team August 4, 2021 12:17 PM UTC

Hi Sandra, 
 
Thanks for your update. 
 
We tried to reproduce your reported issue at our end by preparing sample with your shared files, but no luck. So we request you to share runnable issue replicating sample with us to avoid frequent issue you are facing during integrating our provided solutions in your project. We will resolve all your reported issues and requirements reported in forums 167521 and 167351 in that sample and provide prompt solution. 
 
Regards, 
Vinitha 


Loader.
Up arrow icon