level 1
My__Angle1
楼主

如上图,我在gridpanel里面的表决意见一列,加入的是 xtype: 'widgetcolumn',我想每一行都可以选择一个radio,来显示出每一行的结果是否同意,但是实际结果是所有radio只能选一个,选了第一行的不同意,再点击第三行的同意,第一行就没效果了,其他的也是一样,只能选一个,代码如下Ext.onReady(function(){
Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['building', 'unit', 'floor','room','address','area','option','name'],
data:{result:[
{building:"A栋",unit:"1单元",floor:"2",room:"1",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"109.34",name:"张三"},
{building:"A栋",unit:"1单元",floor:"3",room:"2",address:"鹅岭西路18号宝乐园A栋1单元3层01号房",area:"43.36",name:"张三"},
{building:"A栋",unit:"1单元",floor:"4",room:"3",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"99.08",name:"张三"},
{building:"A栋",unit:"1单元",floor:"2",room:"4",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"104.28",name:"张三"},
{building:"A栋",unit:"1单元",floor:"1",room:"5",address:"鹅岭西路18号宝乐园A栋1单元4层01号房",area:"104.90",name:"张三"},
{building:"A栋",unit:"1单元",floor:"5",room:"6",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"109.34",name:"张三"},
{building:"A栋",unit:"1单元",floor:"7",room:"7",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"43.36",name:"张三"},
{building:"A栋",unit:"1单元",floor:"3",room:"8",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"99.08",name:"张三"},
{building:"A栋",unit:"1单元",floor:"2",room:"9",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"109.34",name:"张三"},
{building:"A栋",unit:"1单元",floor:"9",room:"10",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"104.90",name:"张三"},
{building:"A栋",unit:"1单元",floor:"3",room:"11",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"109.34",name:"张三"},
{building:"A栋",unit:"1单元",floor:"2",room:"12",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"43.36",name:"张三"},
{building:"A栋",unit:"1单元",floor:"2",room:"13",address:"鹅岭西路18号宝乐园A栋1单元2层01号房",area:"109.34",name:"张三"}
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
rootProperty: 'result'
}
}
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: '楼栋', dataIndex: 'building' },
{ text: '单元', dataIndex: 'unit', flex: 1 },
{ text: '楼层', dataIndex: 'floor' },
{ text: '室', dataIndex: 'room'},
{ text:'详细地址', dataIndex: 'address',width:300},
{ text: '面积', dataIndex: 'area'},
{
xtype: 'widgetcolumn',
text: '表决意见',
width: 200,
align: 'center',
widget: {
xtype:'radiogroup',
name:'FileItype', //后台返回的JSON格式,直接赋值;
items:[
{boxLabel:'同意',name:'option',inputValue:1},
{boxLabel:'不同意',name:'option',inputValue:2}
],
scope: this
},
scope: this
},
{ text: '姓名', dataIndex: 'name'}
],
height: 510,
width: 1100,
columnLines: true,
renderTo: Ext.getBody()
});
});