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

Load schedule dynamic through ajax - don't want to use on demand load


Hi,

I am using schedule control with horizontal view and, multiple resource grouping , based on some drop downs in my view need to repopulate everything in the schedule , like groups, resources, appointments...

I need to load resources and appointments when user select an office from drop down.

I tried some thing like this below and not working, its just for appointments, i need to load resources also via ajax. 
i am writing all the javascript code in a separate js file

var url = $('#schedule').data('request-url');
        $.ajax({
            url: url,
            type: "GET",
            dataType: 'json',
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                //$("#Schedule1").ejSchedule({ group: { resources: [args.model.text, "Owners"] } });
                $("#Schedule1").ejSchedule({
                    appointmentSettings: {
                        dataSource: data,
                        id: "StaffId",
                        subject: "Subject",
                        startTime: "StartTime",
                        endTime: "EndTime",
                        description: "Description",
                        allDay: "AllDay",
                        recurrence: "Recurrence",
                        recurrenceRule: "RecurrenceRule",
                        resourceFields: "GroupId,StaffId"
                    }
                });
            }
        });

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team September 2, 2015 02:30 PM UTC

Hi Vivek,
Thanks for contacting Syncfusion Support.
We have found the same query has been posted in this forum as well as in incident, which is created under your account. So, we addressed your query in that incident itself with proper details. Therefore, we request you to keep track on the incident to know more details about this requirement.
Please let us know if you need any further assistance on this.
Regards,
Karthigeyan


FA Fanisa September 21, 2015 08:02 AM UTC

Where was this answered?



KK Karthigeyan Krishnamurthi Syncfusion Team September 22, 2015 12:36 PM UTC

Hi Fanisa,

We have prepared the sample to meet the requirement “Load schedule dynamic through ajax - don't want to use on demand load”, which can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/forum/120116/ze/CustomSampleForJob_-_Copy-2118329418

In the above sample we have used the local database (ScheduleData.mdf), which contains the tables “Appointments, Resources, Groups, OfficeTypes” with requested field values. And displayed the “officetype (office1, office2)” in the dropdown and based on the selection we have filtered the “Groups, Resources and Appointments” and rendered the Schedule control based on the filtered data.


Note:
 We have removed the packages references from the above sample. Therefore, we request you to add the necessary packages reference before running the sample.

Regards,
Karthigeyan.


Loader.
Live Chat Icon For mobile
Up arrow icon