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});