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

Datasource

In samples to use ejSchedule : 


   var dManager = ej.DataManager({

                url: "http://mvc.syncfusion.com/OdataServices/Northwnd.svc"

            });

// Query creation

   var queryString = ej.Query().from("Events").take(10);

 

$(function () {

    $("#Schedule1").ejSchedule({

                appointmentSettings: {

                    dataSource: dManager, query: queryString

                }

            });

     });


But what if i don't want to create WCF Odata for schedule what if i have the method like this  http://mysrervice.svc/getsdata that return JSON   with fields Subject,ID,recurrence and all other fields. 
The question is how to parse JSON data to Schedule Appointments  ? 
...

2 Replies

ST Sergiy Tokarchuk November 20, 2014 05:44 PM UTC

Figure out : 
 var       wd = [{
                Id: 100,
                Subject: "Bering Sea Gold",
                StartTime: new Date(new Date().setMinutes(new Date().getMinutes() + 6)),
                EndTime: new Date(new Date().setHours(new Date().getHours() + 2)),
                AllDay: false,
                Recurrence: true,
                RecurrenceRule: "FREQ=DAILY;INTERVAL=2;COUNT=10"
            },
    {
        Id: 101,
        Subject: "Bering Sea Gold",
        StartTime: new Date().setHours(4, 0),
        EndTime: new Date().setHours(5, 0),
        AllDay: false,
        Recurrence: false
    },

            ];

            var dManager = ej.DataManager(wd);
            $("#Schedule1").ejSchedule({
                width: "100%",
                height: "525px",
                appointmentSettings: {
                    // the dManager collections
                    dataSource: dManager, ....


syncfusion Guys please make online docs BETTER !!! 


KP Krishna Priya Sethuramalingam Syncfusion Team November 21, 2014 01:24 PM UTC

Hi Sergiy,

 Thanks for using syncfusion products.

Query 1: We are displaying the appointments based on the JSON data, so you are passing the JSON data, hence no need of any conversion. But we need to bind the "appointment fields" as mentioned in the below code snippet.

<Code>

appointmentSettings: {

 

                    dataSource: dManager,

                    id: "Id",

                    subject: "Subject",

                    startTime: "StartTime",

                    endTime: "EndTime",

                    allDay: "AllDay",

                    recurrence: "Recurrence",

                    recurrenceRule: "RecurrenceRule"

 

                }

</Code>

We have attached sample for your reference and sample could be dowloaded from the following location.

http://www.syncfusion.com/downloads/support/directtrac/general/F117639-1595709916.zip


Query 2:

We will update the document in our online location ASAP.

Please let us know, if you need any other assistance.

Regards,

Krishna Priya.S


Loader.
Live Chat Icon For mobile
Up arrow icon