Hello,
I have strange/unexpected behaviour from a combo box.
The following combo box is on a Modx FormPanel:
xtype: 'my-combo'
,fieldLabel: 'Property'
,emptyText: 'Select a property to view calendar...'
,allowBlank: true
,name: 'property'
,listeners: {
'select': {fn:this.filterMonths(id),scope:this}
}
The registered listeners listens for select events on the combo. The function looks like this:
,filterMonths: function(id) {
alert('About to toddle off to the server...');
MODx.Ajax.request({
url: Tariffs.config.connector_url
,params: {
action: 'mgr/calendar/getmonth'
,property: id
}
});
}
Although it works - but not as expected.
The function filterMonths() only gets called once, when the CMP initially loads. I see the alert, I see the expected log entries created by getmonth.php, but after that... nothing. How much I select from that combo, the event doesn’t get fired and no Ajax calls are being done...
I’m a bit perplexed, to be honest. I would expect that function to be called upon each time I change the selected item of the combo???