Unable to load events

2 posts, 0 answers
  1. Jason
    Jason avatar
    5 posts
    Member since:
    Dec 2011

    Posted 18 May 2017 Link to this post

    Hi all,

    I have been fighting with the scheduler (2017.2.504) for the past few days. I'm simply trying to get two very simple events from my ASP.NET Core WebAPI.

    You may find below the configuration of my kendo scheduler:

    $('#scheduler').kendoScheduler({
           date: new Date(),
           dataSource: {
               batch: true,
               schema: {
                   model: {
                       id: 'bookingId',
                       fields: {
                           bookingId: { type: 'number', from: 'bookingId' },
                           start: { type: 'date', from: 'start' },
                           end: { type: 'date', from: 'end' },
                           title: { from: 'title' },
                           resourceId: { type: 'number', from: 'resourceId' }
                       }
                   }
               },
               transport: {
                   read: {
                       url: 'http://localhost:57627/api/v1.0/bookings',
                       dataType: 'jsonp'
                   },
                   parameterMap: function (options, operation) {
                       if (operation === 'read') {
                           // Default values
                           return { start: '2017-05-01', end: '2017-05-31', tectaclocationid: 'locations/801' };
                       } else if (operation !== 'read' && options.models) {
                           return { models: kendo.stringify(options.models) };
                       }
                       return null;
                   }
               }
           },
           resources: [{
               field: 'resourceId',
               dataValueField: 'resourceId',
               dataTextField: 'code',
               name: 'Resources'
               dataSource: this.resources
           }]
       });

     

    I'm able to confirm that the "bookings" endpoint is correctly called by the scheduler. It always returns the following JSON array:

    [{"bookingId":1111,"start":"2017-05-19T06:00:00","end":"2017-05-19T07:00:00","resourceId":1227756,"title":"Test 1"},{"bookingId":2222,"start":"2017-05-19T08:00:00","end":"2017-05-19T09:00:00","resourceId":1227756,"title":"Test 2"}]

     

    My resources are correctly loaded (i can see them) but i'm unable to load/see those events. I tried to change the date format, the resourceId, the title without success. I'm probably missing something big :)...

    Any idea? 

    Thank you so much

  2. Jason
    Jason avatar
    5 posts
    Member since:
    Dec 2011

    Posted 18 May 2017 in reply to Jason Link to this post

    Found the problem... DataType should be json and not jsonp!

    Thx

    Seb

Back to Top