PDA

View Full Version : Calendar Event data loading from HttpProxy



bensjomic
25 Oct 2010, 1:41 PM
Hello everyone,

I've a problem with loading external data from a HttpProxy in the calendar.
It will work, i've i use :


eventStore = new Ext.data.JsonStore({
id: 'eventStore',
root: 'evts',
autoLoad: true,
data: eventList, // defined in event-list.js
proxy: new Ext.data.MemoryProxy(),
fields: Ext.calendar.EventRecord.prototype.fields.getRange(),
sortInfo: {
field: 'StartDate',
direction: 'ASC'
}
});

but if i try to use:


eventData = new Ext.data.HttpProxy({
url:'scheduler/events',
method: 'POST'
});

eventStore = new Ext.data.JsonStore({
id: 'eventStore',
root: 'evts',
autoLoad: true,
//data: eventList, // defined in event-list.js
proxy: eventData,
fields: Ext.calendar.EventRecord.prototype.fields.getRange(),
sortInfo: {
field: 'StartDate',
direction: 'ASC'
}
});

it doesn't work. why give this a problem?
The json code which will be send by /scheduler/events is:



"evts": [{
"id": 1001,
"cid": 1,
"title": "Vacation",
"start": "2010-10-16 12:00:00",
"end": "2010-10-16 13:30:00",
"ad": true,
"notes": "Have fun"
}]

Can someone help me with this problem?

Thank you kindly forward,

Michael

Xam335
26 Oct 2010, 1:00 AM
Same here. Using the default Httpproxy by just setting an url to the JsonStore doesn't work. The loading happens but there seems to be a problem in a eval() somewhere. While using strictly the same json in the data property works perfectly.
I still haven't solved this issue.

alaindeseine
29 Oct 2010, 2:23 AM
Hi,

It seems that the eventRecord, use the ISO8601 date format, so return "2010-10-16T12:00:00" instead of "2010-10-16 12:00:00" may help. Or change the date format in EventRecord.js

Hope this help.

Alain Deseine.
France