Sencha touch 2.3.0表单面板发送组合框的文本值而不是id为sub时的id值

时间:2014-01-22 11:58:20

标签: sencha-touch sencha-touch-2

我有一个具有多个组合框的sencha触摸表单,但是当我提交formpanel时,显示字段值将在请求中而不是值字段中发送。我正在使用sencha touch 2.3.0。

        this.getDetailsPanel().submit({
            url: 'savedetails.php',
            method: 'POST',
            success: function() {
                alert('form submitted successfully!');
            },
            failure:function(){
                alert("connection error");
            }
        });
}

任何指针..?表格中使用的组合框如下所示

 {
                    xtype: 'selectfield',
                    name: 'assignedToDepartment',
                    label: 'Assigned to Department',
                    options:[
                             {text:'All',value:'0'},
                             {text:'Daniel Craig',value:'1'},
                             {text:'Sean Connery',value:'2'}
                             ]
                },

1 个答案:

答案 0 :(得分:0)

尝试在selectfield中使用displayFieldvalueField配置。

喜欢这个

{
    xtype: 'selectfield',
    name: 'assignedToDepartment',
    label: 'Assigned to Department',
    displayField : 'text',
    valueField : 'value',
    options:[
      {text:'All',value:'0'},
      {text:'Daniel Craig',value:'1'},
      {text:'Sean Connery',value:'2'}
   ]
},