Devextreme-reactive: How can i prevent entering multitask for same time?

Created on 19 Jun 2020  路  3Comments  路  Source: DevExpress/devextreme-reactive

For React Scheduler

I want only 1 task to enter in 1 hour. Is it possible?

Also, Is this scheduler available for responsive?

Scheduler question

Most helpful comment

Hello,

We do not have such functionality out of the box. But it is possible to create a custom Plugin (see our article on the subject). This custom plugin should override onDoubleClick event in the cell Template (and in allDayPanelCell Template if you use the AllDayPanel plugin). Before firing onDoubleClick it is necessary to check whether the cell is already occupied. To do that, you need to iterate through timeTableAppointments (allDayAppointments in case of allDayPanelCell). You can get these appointments through TemplateConnector. If there isn't any appointments in the cell you can fire onDoubleClick. Here is an example of this approach in action: https://codesandbox.io/s/cranky-booth-p1gw7?file=/demo.js.
If you use grouping, apart from the dates you should check appointment's groups as well.

One more point: do not forget about plugin order. It affects the way plugins interact with each other. In this case, your custom plugin should be after View plugins but before the AppointmentForm.

Does this solution suit you requirements?

All 3 comments

Hello,

We do not have such functionality out of the box. But it is possible to create a custom Plugin (see our article on the subject). This custom plugin should override onDoubleClick event in the cell Template (and in allDayPanelCell Template if you use the AllDayPanel plugin). Before firing onDoubleClick it is necessary to check whether the cell is already occupied. To do that, you need to iterate through timeTableAppointments (allDayAppointments in case of allDayPanelCell). You can get these appointments through TemplateConnector. If there isn't any appointments in the cell you can fire onDoubleClick. Here is an example of this approach in action: https://codesandbox.io/s/cranky-booth-p1gw7?file=/demo.js.
If you use grouping, apart from the dates you should check appointment's groups as well.

One more point: do not forget about plugin order. It affects the way plugins interact with each other. In this case, your custom plugin should be after View plugins but before the AppointmentForm.

Does this solution suit you requirements?

That's great. Thank you so much!

You are welcome!

Was this page helpful?
0 / 5 - 0 ratings