PDA

View Full Version : Combo.setValue() is not submitted?



SaikoJosh
6 Apr 2010, 1:25 PM
Hi,

I've been reluctant to post this question as I thought the answer must be out there somewhere, but I've given in for now.

What I'm trying to do is set the default value of this combo box and then submit that value to the server. This appears to work as the correct value is selected from the list, however, when the form is submitted the server receives "". Instead, if I specifically select a value it submits correctly.

What am I doing wrong?




{
xtype: 'combo',
fieldLabel: 'Category',
anchor: '60%',
displayField: 'Name',
valueField: 'ID',
name: 'Category',
hiddenName: 'CategoryID',
hiddenId: 'hidCategoryID',
id: 'combCategory',
forceSelection: true,
shadow: true,
editable: false,
allowBlank: false,
mode: 'local',
triggerAction: 'all',
emptyText: 'Select a category...',
selectOnFocus: true,
store: new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: 'php/datagrab.editproductdata.php',
method: 'POST'
}),
baseParams: {
a: 'grabcategorylist',
sk: Application.SessionKey
},
autoLoad: true,
root: 'root',
fields:[
{name: 'CategoryID', mapping: 'item_ID'},
{name: 'Name', mapping: 'name'}
],
listeners: {
'load': function() {
var StoreData = StrEditProductData.getAt(0).data
Ext.getCmp('combCategory').setValue(StoreData.CategoryName);
}
}
})
}



Cheers,
-Josh.