zoukankan      html  css  js  c++  java
  • EXTJS 4.2 资料 控件之radiogroup 的用法

    最近在EXTJS4.2开发项目,radiogroup的用法,主要是和grid之间的编辑功能;看了好多资料都不对,特此在这里备注记录

    代码如下,

    1.这是一段Win窗体上的两个单选按钮,设置单选按钮都是选择“是”

    a、

     {
                   xtype: 'fieldcontainer',
                   layout: 'hbox',
                   defaults: {
                       flex: 1
                   },
                   items: [{
                       xtype: 'radiogroup',
                       fieldLabel: '手机验证',
                        100,
                       items: [
                            { boxLabel: '', name: 'PhoneValidate', inputValue: 'true', checked: true },
                            { boxLabel: '', name: 'PhoneValidate', inputValue: 'false' }
                       ]
                   }, {
                       xtype: 'radiogroup',
                       fieldLabel: '邮箱验证',
                        100,
                       items: [
                           { boxLabel: '', name: 'EmailValidate', inputValue: 'true', checked: true },
                           { boxLabel: '', name: 'EmailValidate', inputValue: 'false', }
                       ]
                   }
                   ]
               }

    b、错误代码:

    2.grid 行操作代码:

      {
                            header: '操作',
                            xtype: 'actioncolumn',
                             100,
                            items: [{
                                //这里直接通过URL设置图标
                                icon: '/Resources/Images/16x16/blue16_020.gif',
                                tooltip: '编辑',
                                //这里是图标的点击事件
                                //参数中有点击行的record , 所以很方便做处理
                                handler: function (grid, rowIndex, colIndex) {
                                    update();
                                }
                            }, '   ', {
                                icon: '/Resources/Images/16x16/blue16_013.gif',
                                tooltip: '删除',
                                handler: function (grid, rowIndex, colIndex) {
                                    deleted();
                                }
                            }]
                        }

    3.update() 代码片段:

        function update() {
            var selectedData = grid.getSelectionModel().getSelection()[0].data;
            if (selectedData.length < 1)
            { Ext.MessageBox.alert('提示', '请选择要编辑的记录!'); return; }
            else
            {
                win.show();//这是弹出窗体
                form.form.loadRecord(grid.getSelectionModel().getSelection()[0]); 
       
                form.form.findField('PhoneValidate').setValue('false');//这个手机验证单选按钮
                form.form.findField('EmailValidate').setValue('false');//这个邮箱验证单选按钮
               
            }
        }

    4.弹出效果图:

  • 相关阅读:
    空指针调用函数【可以成功】
    静态库的pdb
    构造、析构、虚函数使用小细节
    Hutool,一个贼好用的 Java 工具类库,用过都说好~
    kk-anti-reptile是,适用于基于spring-boot开发的分布式系统的反爬虫组件。
    对于thinkpad 触摸板双击失灵
    tomcat7-maven-plugin 启动的服务如何关闭
    怎样关闭占用80端口的pid为4的进程
    C# 时间比较
    一道sql面试题
  • 原文地址:https://www.cnblogs.com/foreverfendou/p/4244754.html
Copyright © 2011-2022 走看看