zoukankan      html  css  js  c++  java
  • 学习ExtJS(三) TextField常用方法

    一、属性
    fieldLabel:标签名称。
    labelWidth:标签宽度。
    ID:文件框ID。

    二、构造参数
    listeners:在对象初始化之前,将一系列事件进行绑定。

    三、函数
    getCmp(string _id):得到id为_id的组件对象。
    getValue():得到文件框值。

    四、其它
    layout:只在在此布局下才能正确显示文件框的标签名,布局的宿主对象必面
                     是Ext.Container或者Ext.Container的子类。
    在应用FormLayout布局时只要在宿主对象的构造参数中指定layout:"form"即可。      
             
    五、应用举例    

    Ext.onReady(function(){
            var _panel 
    = new Ext.Panel({
                            renderTo:Ext.getBody(),
                            layout:
    "form",
                            labelWidth:
    30,
                            listeners:{
                                
    "render":function(_panel){
                                            _panel.add(
    new Ext.form.TextField({
                                                        id:
    "txt_name",
                                                        fieldLabel:
    "姓名"
                                                    })) ;
                                         }
                            }}) ;
            
    new Ext.Button({
                    text:
    "确 定",
                    renderTo:Ext.getBody(),
                    handler:function(){
                                
                                alert(Ext.getCmp(
    "txt_name").getValue()) ;
                            }
                }) ;
            
        }) ;
  • 相关阅读:
    Leetcode 257. 二叉树的所有路径
    Leetcode 1306. 跳跃游戏 III
    Leetcode 编程中好用的一些C++用法
    Leetcode 96. 不同的二叉搜索树
    Leetcode 892. 三维形体的表面积
    Leetcode 219. 存在重复元素 II
    Leetcode 5281. 使结果不超过阈值的最小除数
    springboot多租户设计
    MAC电脑修改Terminal以及vim高亮显示
    基于springboot搭建的web系统架构
  • 原文地址:https://www.cnblogs.com/easypass/p/1578106.html
Copyright © 2011-2022 走看看