Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

Scheduler - Best practices

$
0
0

This example illustrates the most reliable approach to define the Scheduler extension in your MVC application with the capability to perform CRUD operations. 

The main principal is isolation of extension settings. They are isolated to a separate SchedulerHelper class. The SchedulerPartial view and SchedulerExtension.GetAppointmentTo* methods (e.g., SchedulerExtension.GetAppointmentsToInsert) use it. It is mandatory for scenarios when CRUD operations are required (e.g., see Lesson 3 - Use Scheduler in Complex Views ). Moreover, it is good practice to always use this design because it guarantees reliable extension operation. Note that it is applicable for other extensions such as GridView (see T191698 - How to isolate extension settings into separate helper class and share a single partial view to display multiple extensions), HtmlEditor (see T280805: HtmlEditor - Insert media content buttons are disabled), etc. 

In addition, we define the SchedulerHelper.CreateSchedulerSettings method as an extension method (e.g., see How to: Implement and Call a Custom Extension Method) for the HtmlHelper class. This allows us to access HtmlHelper facilities in the extension method (by default, they are available in the View context only). The  T191698 - How to isolate extension settings into separate helper class and share a single partial view to display multiple extensions code example illustrates a more universal approach (the WebViewPage class is used instead of the HtmlHelper class).


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>