我定义了一个数据源,返回的是json数据
var radStore1 = new Ext.data.JsonStore({
root:'results',
fields:['seneceid','senecefact1'],
method:'post',
url:'${ctx}/discretion/discretiontempale!querySencefact1.action?sid='+sid+'&caseid='+caseid,method:'post',
autoLoad:true
}); /// 下面的是我写的RadioGroup代码
xtype: 'fieldset',
id : 'smpradio1',
title: '<span class="fs_flag">*</span> 情节一',
autoHeight: true,
hideLables: true,
items:[{
xtype: 'ux-radiogroup',
name : 'senecefact1', //名称
horizontal: true, //值为true则表示Radio选项水平排列,false则表示垂直排列,默认值为false
// 下面的代码是我乱写的, 没保存,显示‘senecefact1’,我就是不知道这里怎么显示我后台获取的JSON数据
store: radStore1,
radios: [{
value: 'seneceid',
boxLabel: 'senecefact1'
}]
}]
求Ext 达人解答我的难题,谢谢!
var radStore1 = new Ext.data.JsonStore({
root:'results',
fields:['seneceid','senecefact1'],
method:'post',
url:'${ctx}/discretion/discretiontempale!querySencefact1.action?sid='+sid+'&caseid='+caseid,method:'post',
autoLoad:true
}); /// 下面的是我写的RadioGroup代码
xtype: 'fieldset',
id : 'smpradio1',
title: '<span class="fs_flag">*</span> 情节一',
autoHeight: true,
hideLables: true,
items:[{
xtype: 'ux-radiogroup',
name : 'senecefact1', //名称
horizontal: true, //值为true则表示Radio选项水平排列,false则表示垂直排列,默认值为false
// 下面的代码是我乱写的, 没保存,显示‘senecefact1’,我就是不知道这里怎么显示我后台获取的JSON数据
store: radStore1,
radios: [{
value: 'seneceid',
boxLabel: 'senecefact1'
}]
}]
求Ext 达人解答我的难题,谢谢!
如果你非要获取store 也得radStore1.load()一下
如果radio内容需要后台交互的话 那么得发起ajax请求 在回调函数中动态的用js往smpradio1的items中加
你的意思是说这里用store是没有用的, 要动态的创建一个radio,然后再加载到raioGroup中去吗?
大侠,麻烦你把示例代码发给我,我主要是不知道怎么创建radio ,再添加到radios中