Extjs的radio单选框的使用

Extjs的radio的FormPanel的代码如下:

{  xtype : 'radiogroup',
    fieldLabel : '是否置顶',
    name:'isTop',
     items : [{
                boxLabel : '置顶',
                name:'isTop',
                inputValue : '1'
                }, {
                 boxLabel : '不置顶',
                 name:'isTop',
                 inputValue : '0',
                 checked:true
              }]
            }

其实,在win中用submit()就可以提交,可是因为涉及到了kindeditor,submit()提交无法获得kindeditor的内容,故用ajax提交,

其中,ajax获取radio的内容方法如下:

var form = this.formPanel.getForm();

var isTop = form.getValues()["isTop"];

像别的textField等都可以直接获取:如:

var form = this.formPanel.getForm();

var rulesAuthor = form.findField("rulesAuthor").getValue();

原文地址:https://www.cnblogs.com/zrui-xyu/p/4626782.html