【发布时间】:2012-03-30 11:58:39
【问题描述】:
您好论坛成员我在 extjs 4 中设置无线电场时遇到一个问题
我的表单 radiogroup xtype 代码如下
{
xtype: 'radiogroup',
dataIndex: 'gender',
margin: 5,
fieldLabel: 'Gender',
items: [{
xtype: 'radiofield',
name: 'gender',
boxLabel: 'Male',
inputValue:'0'
}, {
xtype: 'radiofield',
name: 'gender',
boxLabel: 'Female',
inputValue:'1'
}]
}
我收到的 json 数据是
{
"total": 1,
"success": true,
"employeedata": [{
"username": "yaryan997",
"surname": "Singh",
"firstname": "Yogendra",
"gender": false
}]
}
我的员工列表视图具有执行以下功能的操作列 editEmployee
editEmployee:function(grid,no,rowindex,colindex,temp) {
alert('Edit EMPLOYEE button pressed');
var rec = grid.store.getAt(rowindex);
var employeeid = rec.get('id');
store = grid.getStore();
store.load({
params: {'employeeid':employeeid},
scope: this,
callback: function(records, operation, success) {
//the operation object contains all of the details of the load operation
console.log(records);
this.getEmployeeEdit().editform=1;
this.getEmployeeEditForm().loadRecord(rec);
this.getEmployeeEdit().show();
}
});
this.getEmployeeStore().load();
},
根据 id 显示 editEmployee 视图。我的编辑员工正确显示了所有值,但唯一的问题是无线电场。他们没有显示选定的值。
我提供给您的 json 数据,以员工数据的形式出现
我无法根据从 json 接收到的数据设置无线电组性别。
请给我一些解决方案。
【问题讨论】:
-
您的收音机 inputValues 是字符串,您的 json 中“性别”的数据类型是 bool。也许那里有问题?
标签: javascript extjs extjs4