Hi,
I have my calendar working and I’m pretty happy with the result, although I need to do some tweaking on the CSS yet. See the attached screenshot.
The following happens:
- The manager/user navigates to the calendar tab and selects a property from a combo.
- After selection of a property a processor is kicked off which collects 4 rolling months from the calendar for that property. This is done via a MODx.Ajax.request
MODx.Ajax.request({
url: Tariffs.config.connector_url
,params: {
action: 'mgr/calendar/getmonth'
,cottage: Ext.getCmp('cottages').getValue()
}
,listeners: {
'success': {fn:function(reply) {
this.setPanels(reply.message);
}, scope:this}
,'failure': {fn:function(r) {
},scope:this}
}
});
- The processor instantiates a calendar object with an HTML renderer and the renderer produces an HTML representation of the requested calendar months. This HTML representation is then returned to the browser via the reply object where it is dissected into 4 individual HTML strings, each representing a month. These strings are then placed into the individual months (each month is a separate MODx.panel).
,setPanels: function(months) {
var broken = months.split('</table>');
Ext.getCmp('month1').update(broken[0]);
Ext.getCmp('month2').update(broken[1]);
Ext.getCmp('month3').update(broken[2]);
Ext.getCmp('month4').update(broken[3]);
}
Although this works, I consider the transport of the HTML string via the reply object a bit of a hack.
I’ve experimented a bit with a JSON store but could not get that to work.
So, my question: is it possible to introduce a JSON store for the above and if so, how would I go about doing that?
Thanks, and apologies for the really long post...