Here's the configuration for my combo box:
Code:
{
fieldLabel: 'Testing Combo',
name: 'testing_combo',
xtype: 'combo',
mode: 'remote',
autoLoad: true,
typeAhead: true,
store:
{
xtype: 'jsonstore',
url: 'http://calendar.manchacaumc.org/dev2/api/get-contacts.pl',
root: 'contacts',
fields: [
'id',
'name'
],
listeners: {
// load: function(records, options) {
// alert('loaded ' + records.totalLength + ' records');
// },
loadexception: function(proxy, options, response, error) {
alert('error loading records from server:');
}
}
},
listWidth: '300',
hiddenName: 'testing_combo_name',
triggerAction: 'all',
valueField: 'id',
displayField: 'name'
}
There are two thing about this. The first, is that if I use 'width' and not the 'anchor' with a percentage, then FireFox 3 renders the trigger to the left of the text field and you cannot trigger it.
The second, and more important thing, is that upon trigger the drop-down just sits with
"Loading..." and an endless spinner. Using FireBug I can see that the get-contacts.pl returns the following data (a single entry) as the entire contents of the body:
{"contacts":[{"name":"John Doe","id":"332"}]}
I'm not certain what content-type I should use for the get-contacts.pl, so I'm just returning text/plain.
Thanks in advance!