How can I validate the title if it is empty
fields: {
taskId: { type: 'number' },
title: { validation: { required: true } }, /* Validation not working */
start: { type: 'date'},
end: { type: 'date' },
IdUsuario: { defaultValue: 1 },
IdSucursal: { nullable: true },
}
<kendo-scheduler :data-source="localDataSource"
:date="date"
:timezone="'Etc/UTC'"
:allDaySlot="false"
:height="750"
schema-model-id="taskId"
:schema-model-fields="fields"
:resources="catalogs"
:messages="messages"
@change="onChange"
@edit="onEdit"
@add="onAdd"
@cancel="onCancel"
@dataBound="onDataBound"
@move="onMove"
@navigate="onNavigate"
@resize="onResize"
@save="onSave">
<kendo-scheduler-view :type="'day'" :selected="true"></kendo-scheduler-view>
<kendo-scheduler-view :type="'workWeek'"></kendo-scheduler-view>
<kendo-scheduler-view :type="'week'"></kendo-scheduler-view>
<kendo-scheduler-view :type="'month'"></kendo-scheduler-view>
<kendo-scheduler-view :type="'agenda'"></kendo-scheduler-view>
</kendo-scheduler>
11 Answers, 1 is accepted
You can refer to this sample demo where the validation worked correctly at my side.
Regards,
Plamen
Progress Telerik
Thanks for the reply.
but the validation of the title does not work in the example and I would like the title to be required.
I have tested the scenario once again but could not insert or update the appointment to be with empty title. Here is my test video. Would you please review it and let me know what else should be done in order to replicate the issue?
Regards,
Plamen
Progress Telerik
you think it's my browser problem, probe with chrome, safari, firefox. and it does not work
https://www.screencast.com/t/j6xznNwk8Ka
The browser is not suggested as possible reason for the described behavior. It is rather related to the setup. The sample linked by Plamen is working as expected and title is validated properly. The best option for us to see and examine the difficulties you have is by changing the code in the sample provided and share the link with the updates. That way we will be able to check the exact code and case that causes the issue.
Regards,
Ianko
Progress Telerik
the problem is that the example that I look at is the one in the documentation of vue
in this example https://www.telerik.com/kendo-vue-ui/components/scheduler/
video example https://www.screencast.com/t/j6xznNwk8Ka
The demo linked is not dedicated to show validation of fields bound through local sources. However, this can be achieved by setting up a kendo.data.SchedulerDataSource instance to the datasource, where you can define the model's fields and their validation. Here you are a modified example: https://plnkr.co/edit/t3vFg2UnMxsSChwq9Z3c?p=preview.
Regards,
Ianko
Progress Telerik
The plunker linked in my last reply hasn't updated properly. Here you are a new one: https://plnkr.co/edit/V9gtYLy6CNNLYzbUS8BP?p=preview.
Regards,
Ianko
Progress Telerik
new kendo.data.SchedulerDataSource It works very well
my question is how to add more elements or eliminate using kendo.data.SchedulerDataSource
Thanks lanko
As the SchedulerDataSource extends the DataSource, it is best to use the API methods to interfere with the data bound to the DataSource of the widget used. You can check the API documentation here: https://docs.telerik.com/kendo-ui/api/javascript/data/datasource.
Also, if you are interested in reactive binding, you can check out this more advanced example of Kendo UI, Vue and Vuex here: https://www.telerik.com/blogs/get-more-out-of-vue-kendo-ui-using-vuex.
Regards,
Ianko
Progress Telerik