Wednesday, July 25, 2012

extjs4 – EXTJS Combox – Store does load but doesn't show



Given the following javascript:



var fo = Ext.create(\'Ext.form.Panel\', {
layout:\'box\',
...
items: [{
xtype: \'combobox\',
valueField: \'id\',
displayField: \'organizationtype\',
store: {
storeId: \'zaza\',
fields: [{name: \'id\'}, {name: \'organizationtype\'}],
root: \'data\',
autoLoad: true,
proxy: {
type: \'ajax\',
url: \'/apps/crm_organizations/orgtype/\',
reader: {
type: \'json\'
}
}
},
fieldLabel: \'Type relation\',
name: \'organizationtype\',
queryMode: \'local\',
},
...


This panel contains – among other fields – also this combobox. I can see with wireshark that the url \’/apps/crm_organizations/orgtype/\’ is actually queried. However the combobox doesn\’t show any values. Has this anything to do with the fact that I\’m lazy loading the combobox?


This is the response on the JSON request:



{data: [ {id:\"1\" ,organizationtype:\"Customer\"}
,{id:\"2\" ,organizationtype:\"Relation\"}
,{id:\"3\" ,organizationtype:\"Supplier\"}
,{id:\"4\" ,organizationtype:\"Unknown\"} ]}






Rating: 4 out of 5 based on 3 ratings



The post extjs4 – EXTJS Combox – Store does load but doesn't show appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/extjs4-extjs-combox-store-does-load-but-doesnt-show.html

No comments:

Post a Comment