jQWidgets Forums

jQuery UI Widgets Forums Plugins Data Adapter DataAdapter loadServerData

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 8 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • DataAdapter loadServerData #89592

    savier
    Participant

    Hi, im using loadServerData override to get data to jqxScheduler, but behavior is quite weird. Ajax call is made twice, one is defined by me in loadServerData, second by scheduler to defined url. I would say that when loadServerData is specified, scheduler should just wait for data from callback? I guess this should be easy, but its not working at all.

    Also why datatype must be json and url set in order to invoke loadServerData method? Thanks for any hints. Petr

    var source =
    {
    datatype: “json”, // must be json, otherwise loadServerData isnt invoked
    dataFields: [
    { name: ‘id’, type: ‘string’ },
    { name: ‘description’, type: ‘string’ },
    { name: ‘location’, type: ‘string’ },
    { name: ‘subject’, type: ‘string’ },
    { name: ‘calendar’, type: ‘string’ },
    { name: ‘start’, type: ‘date’ },
    { name: ‘end’, type: ‘date’ }
    ],
    id: ‘id’,
    url:’/mock’, // mock url – if not set, loadServerData isnt invoked
    };

    var adapter = new j$.jqx.dataAdapter(source,{
    loadServerData: function (serverdata, source, callback) {
    console.log(‘load data’);
    // Custom ajax call to obtain data
    EventCalendarController.getEvents(function(result, event){
    callback({ records: result });
    });
    }
    });

    j$(“#scheduler”).jqxScheduler({
    date: new j$.jqx.date(2016, 11, 23),
    width: ‘100%’,
    height: 600,
    contextMenu: false,
    editDialog: false,
    dayNameFormat: “abbr”,
    source: adapter});

    DataAdapter loadServerData #89638

    Hristo
    Participant

    Hello savier,

    It will be normal because when set source with this ‘adapter’.
    And I would like to ask you about your “EventCalendarController” object?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.