• 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.弹出效果图:

  • 相关阅读:
    Java并发基础10:原子性操作类的使用
    Java并发基础09. 多个线程间共享数据问题
    Java并发基础08. 造成HashMap非线程安全的原因
    Java并发基础07. ThreadLocal类以及应用技巧
    Java并发基础06. 线程范围内共享数据
    Java并发基础05. 传统线程同步通信技术
    Java并发基础04. 线程技术之死锁问题
    我是如何从通信转到Java软件开发工程师的?
    IOS 判断耳机插入/拔出
    海量数据处理
  • 原文地址:https://www.cnblogs.com/foreverfendou/p/4244754.html
Copyright © 2020-2023  润新知