- Home
- Forum
- ASP.NET MVC
- Scheduler in Resource View
Scheduler in Resource View
Thanks for contacting Syncfusion support.
We have prepared a schedule sample to meet your requirement which can be downloaded from the following location.
http://www.syncfusion.com/downloads/support/forum/120542/ze/ScheduleMultipleResource1236107123
In the above sample we have used two database table, named Booking for appointments and Resources for resource data. We bind those data value in schedule as shown in the following code example:
|
<code> [index.cshtml] @(Html.EJ().Schedule("Schedule1") .Width("100%") .Height("525px") .Resources(res => { res.Field("ResourceId").Title("Owner").Name("Owners").AllowMultiple(true).ResourceSettings(flds => flds.Datasource(ds => ds.URL("/Home/GetResources")).Text("Text").Id("Id").Color("Color")).Add(); }) //Bind the resource data value to schedule .Group(gr => { gr.Resources(ViewBag.Resources); }) .AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Home/GetData").CrudURL("/Home/Batch").Adaptor("UrlAdaptor")) //Bind the appointments data to get and also perform CRUD operation .Id("BookingId") .StartTime("StartTime") .EndTime("EndTime") .ResourceFields("ResourceId") //Bind the appointmentSetting field for resource to process the resource value .StartTimeZone("StartTimeZone") .EndTimeZone("EndTimeZone")) public JsonResult GetData() //Method to get the appointments data { IEnumerable data = new ScheduleDataDataContext().Bookings.Take(100); return Json(data, JsonRequestBehavior.AllowGet); }
public JsonResult GetResources() //Method to get the resources data { IEnumerable data = new ScheduleDataDataContext().Resources.Take(100); return Json(data, JsonRequestBehavior.AllowGet); |
Regards,
Sarath Kumar P K
- 1 Reply
- 2 Participants
-
SA saravanan
- Sep 24, 2015 03:25 PM UTC
- Sep 25, 2015 09:36 AM UTC