PDA

View Full Version : Combobox directStore



same
20 Jun 2011, 12:31 AM
Hi,

I'm using a combobox with the directStore to load his data, but when I click to load the data, the loading icon is show but, no result in my combo.

My code :


store: new Ext.data.DirectStore({
paramsAsHash: true,
root : 'data',
baseParams:{
//myForm : formId.getForm().getFieldValues(),
command : 'comboGridUpdate',
notify : colItems[i][Enum_WidgetAttribute.NOTIFY]['click'],
screenNum : this.screenNum,
fieldName: colItems[i][Enum_WidgetAttribute.FIELDNAME]||wgt.name
},...

And the JSON result :


{"tid":7,"action":"FormService","method":"directSubmit","result":{"data":[
"A","A&B","B"]},"type":"rpc"}

skirtle
21 Jun 2011, 8:19 PM
Not sure about the details for a DirectStore but by the looks of it your root is incorrect (should be 'result.data') and you don't have any fields configured. Getting it working with an array of strings like you have in your response could be a little tricky too: could probably do it by overriding extractValues() but if possible it'd be easier to change the server response.