Extjs4 ExtJs:将组名和值作为参数发送
在我的表格中,我使用文本字段、单选组和按钮,如下所示:Extjs4 ExtJs:将组名和值作为参数发送,extjs4,Extjs4,在我的表格中,我使用文本字段、单选组和按钮,如下所示: var radiogroup = new Ext.form.RadioGroup({ fieldLabel: 'Specimen ?', allowBlank: false, name:'isSpecimen', anchor: '85%', items: [
var radiogroup = new Ext.form.RadioGroup({
fieldLabel: 'Specimen ?',
allowBlank: false,
name:'isSpecimen',
anchor: '85%',
items: [
{
boxLabel: 'Yes',
name: 'radio',
inputValue: 'Y'
},
{
boxLabel: 'No',
name: 'radio',
inputValue: 'N',
checked:true
}
]
});
var createOrderForm = new Ext.FormPanel({
renderTo: "createOrder",
frame: true,
width: 500,
items: [
{
xtype: 'textfield',
fieldLabel: 'Instruction',
name: 'instruction',
width: 300,
allowBlank:false
},
radiogroup,
{
xtype : "textfield",
id : 'textfield1',
fieldLabel : "Type",
name : "type",
hidden:true,
width: 300,
disabled:true
}],
buttons:[{
text:'Create',
formBind: true,
listeners: {
click: function(){
Ext.Ajax.request({
url : url+'/lochweb/loch/order/persist',
params : createOrderForm.getForm().getValues(),
success : function(response){
console.log(response.responseText); //<--- the server response
window.location = url+'/lochportal/viewSuccessForm.do';
}
});
}
}
}]
});
var-radiogroup=新的Ext.form.radiogroup({
fieldLabel:“样本”,
allowBlank:false,
名称:'isSpecimen',
主播:85%,
项目:[
{
boxLabel:'是',
名称:'收音机',
输入值:“Y”
},
{
boxLabel:'否',
名称:'收音机',
inputValue:'N',
核对:正确
}
]
});
var createOrderForm=new Ext.FormPanel({
renderTo:“createOrder”,
框架:对,
宽度:500,
项目:[
{
xtype:'textfield',
fieldLabel:“指令”,
名称:'指令',
宽度:300,
allowBlank:false
},
放射组,
{
xtype:“textfield”,
id:'textfield1',
字段标签:“类型”,
名称:“类型”,
隐藏:是的,
宽度:300,
残疾人士:对
}],
按钮:[{
文本:'Create',
是的,
听众:{
单击:函数(){
Ext.Ajax.request({
url:url+'/lochweb/loch/order/persist',
参数:createOrderForm.getForm().getValues(),
成功:功能(响应){
console.log(response.responseText);//当然会发送所选电台的名称和值(这里您将它们指定为“Y”/“N”)。我建议您删除RadioGroup的名称,并将内部电台的名称设置为“isSpecimen”。我的意思是:var RadioGroup=new Ext.form.RadioGroup({fieldLabel:'sample',allowBlank:false,anchor:'85%',items:[{boxLabel:'Yes',name:'isSpecimen',inputValue:'Y'},{boxLabel:'No',name:'isSpecimen',inputValue:'N',checked:true}]});