开发者

ExtJS comboBox only sets value from JSON if no [] in name

using ExtJS 3 here. I just noticed (in reply to my previous question) that the problem appears only when I'm not sending more than one combobox name. I currently have setup my combobox's name like this name[] because I will send an array of values. If I remove the array [], it works but I can only grab the last sent combobox value. My config is a SuperBoxSelect for multiple select purposes but this happens to my combobox also:

new Ext.ux.form.SuperBoxSelect({
       store:storeForCompanies,
       fieldLabel:'CN',
       id:'companyField',
       displayFiel开发者_如何学God: 'company_name',
       valueField: 'id',
       name:'cn',
       hiddenName: 'company[]',
        typeAhead: true,
        mode: 'remote',
        minChars : 0,
        triggerAction: 'all',
        emptyText:'- Choose -',
        selectOnFocus:true,
        allowBlank:true,
       width: 350
})

Do I have any other options to send those ?

Thanks.


I did not found an "out of the box" solution so I attached a success handler to the form.load() that sets value of the combobox to the returned JSON result, like this:

success: function(form, action)
{
Ext.getCmp('companyField').setValue(action.result.data.company);
}

This way it works, don't know why I have to manually set the value for that combobox, I'm just glad I "fixed" a 2 day problem in my application and I am opened for any other suggestion that can point me in getting it fixed in a proper way.

Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜