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. Image for the cookie policy date
close icon

Unable to add multiple resource in schedule, Giving JavaScript Error


I am using Schedule to show planned activities with multiple resource. As per the guideline / help provided, I used same code, but it is giving me JavaScript Error.

My .cshtml file:

@model LuxCRM.Models.PlannerModel

    ViewBag.Title = "Planner";
    var v = Model.PlannerData; //this holds schedule data;
    var v1 = Model.SalesEmployees; // this hold resources

<h2>@Html.LabelFor(model => model.PlannerHeading)</h2>
@using (Html.BeginForm())
        .Resources( res =>
            { res
                .ResourceSettings(flds=> flds
        .Group(gr => { gr.Resources(Model.Resource); })
        .AppointmentSettings(fields => fields.Datasource(v)

My Model :

 public class PlannerModel
        public PlannerModel()
            PlannerData = new List<PlannerData>();
            PlannerHeading = "Scheduler / Planner";
        public List<Models.PlannerData> PlannerData { get; set; }
        [Display(Name = "PlannerHeading", ResourceType = typeof(Resource))]
        public string PlannerHeading { get; set; }
        public List<SalesEmployee> SalesEmployees { get; set; }
        public List<String> Resource { get; set; }

I don't see any problem in this code, I don't understand why it gives me JavaScript error.

I also wanted to understand DataSource (here)method, how it works and what type of data it expect specially first 2 property.

4 Replies

MA Manish November 16, 2015 09:21 AM UTC

in continuation...

I also observed that it is not picking up the timing correctly. Please see the below screen shot of my data coming from HANA.

Timing is pulled correctly from database and it is set in List<> correctly. But while rendering schedule control it shows wrong timing.

KK Karthigeyan Krishnamurthi Syncfusion Team November 17, 2015 09:06 AM UTC

Hi Manish,

Thanks for contacting Syncfusion support.

Please find the following responses for your queries.

Query1:  Script error throws while rendering the multiple resource 

When the resources are used in the scheduler, it is mandatory to map the resource field with the AppointmentSettings. Refer to the following code example to map the ResourceField,
AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Home/GetData").CrudURL("/Home/Batch").Adaptor("UrlAdaptor"))











Query2: Need to understand about Datasource methods

1.       Datasource(Action<DataSourceBuilder>)This method is used, whenever an action is to be performed on the controller side.
                For example: AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Home/GetData").CrudURL("/Home/Batch").Adaptor("UrlAdaptor")))
2.       Datasource(DataSource) – This method is used, whenever the datasource is to be retrieved from the controller side.

For example: ResourceSettings(flds => flds.Datasource(ViewBag.Owners).Text("text").Id("id").GroupId("groupId").Color("color")).Add();

Note: To know more about datasource and datamanager, visit the below User Guide links,



Query3: Appointments are not rendering in given time

We request you to include the StartTimeZone and EndTimeZone fields in the datasource in order to render the appointments at the same time as given in the datasource. We have prepared the sample for the queries 1 and 3, which can be downloaded from the following location,

In the above sample, we have included the ResourceFields, StartTimeZone, and EndTimeZone within the AppointmentSettings. TheStartTimeZone and EndTimeZone fields are included in the datasource. So, the appointments will be rendered at the same time as given in the datasource.


MA Manish November 18, 2015 05:47 AM UTC

Hi Karthigeyan,

Thanks for your support. My problem is resolved and the sample you provided helps me to understand schedule control better.

Once again thanks a lot.

KK Karthigeyan Krishnamurthi Syncfusion Team November 19, 2015 03:57 AM UTC

Hi Manish,

Thanks for your update.

We are happy to hear that our solution  has resolved your issue.


Live Chat Icon For mobile
Up arrow icon