Extis与Radiogroup

Mut*_*ant 4 extjs store radio-group

我们可以在ext中绑定静态json存储与radiogroup吗?

Chr*_*ber 8

Radiogroups和商店在ExtJS中没有直接关系.从商店中填充表单值很容易,但使用商店实际创建字段需要稍作解决.具体来说,你必须做这样的事情(假设Ext 3.3.1),并且你的JsonStore已经设置好了......

var store = <your predefined store, with records>;
var itemsInGroup = [];

store.each( function(record) {
  itemsInGroup.push( {
      boxLabel: record.someLabel, 
      name: record.someName, 
      inputValue: record.someValue
    });  
});

var myGroup = { 
  xtype: 'radiogroup', 
  fieldLabel: 'My Dynamic Radiogroup', 
  items: itemsInGroup 
};
Run Code Online (Sandbox Code Playgroud)