We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to switch between resource groups dynamically in EJMVC Schedule control?

In general, the number of resources to be added to the Schedule control are pre-defined during the control creation and all the resources are rendered based on the resource data. Here, the requirement is to group the resources under another level and display it dynamically on the Schedule control, based on the group selection. To do so, follow the steps provided.

Step 1: Refer to the online sample here and create the usual resource grouping sample.

Step 2: To switch between two groups, add an additional new group Manager by modifying the existing controller page code as follows,

Controller

Step 3: Modify the View page code as follows, to add the Manager group to the resources of the Schedule control. Also, map all the appropriate resource related fields to the resourceFields property within appointmentSettings as follows.

ScheduleFeatures.cshtml

Step 4: Create two radio-buttons to handle the selection between the groups, Room and Manager, as follows.

ScheduleFeatures.cshtml

Step 5: You can dynamically change the group with its associated resources to be displayed on the Schedule control by clicking the required radio button. For this, you need to make use of the client-side event of the two radio-buttons as follows.

ScheduleFeatures.cshtml

Step 6: Define the client-side method onChange under the script section with the following code example to switch between the groups dynamically on the Schedule control, when the radio button is clicked.

JavaScript

Step 7: Now run the sample and the Schedule control is rendered with the initial data and resources as shown in the following screenshot.

 

Figure 1: Schedule with initial resources defined

Step 8: Now, select the option Rooms and the Schedule control is rendered with the selected group Rooms and its associated resources as follows.

Figure 2: Selected group Rooms and its corresponding resources

Step 9: Now, select the option Managers and the Schedule control displays the Manager group and its associated resources, as shown in the following screenshot.

Figure 3: Selected group Manager and its corresponding resources

Sample Link:

http://www.syncfusion.com/downloads/support/directtrac/132062/ze/DynamicResourceFiltering-638246954

 

Article ID: Published Date: Last Revised Date: Platform: Control:
4074 02/17/2015 08/27/2015 ASP.NET MVC Schedule
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.