zoukankan      html  css  js  c++  java
  • ExtJS 使用点滴 九 FormPanel 文本框右边显示备注

    1.var rightShowText = Ext.extend(Ext.util.Observable, {  
    2.    init: function(field){  
    3.        field.on("render",function(obj){  
    4.            var font = document.createElement("font");     
    5.            font.setAttribute("color","black");     
    6.            font.setAttribute("className","rightShowText");     
    7.            font.setAttribute("class","rightShowText");    
    8.            var redStar = document.createTextNode(obj.rightTip);     
    9.            font.appendChild(redStar);     
    10.            obj.el.dom.parentNode.appendChild(font);     
    11.        })  
    12.        field.on("beforedestroy",function(obj){  
    13.             var button = Ext.query("[class=rightShowText]", obj.el.dom.parentNode)[0];  
    14.             Ext.removeNode(button);  
    15.        })  
    16.  
    17.    }  
    18.});
    =====================================================================================================
    1.{fieldLabel: '俩字',  
    2.                     rightTip:"xxxx",  
    3.                     xtype: 'textfield',  
    4.                     plugins:new rightShowText()  
    5.                    } 


    =====================================================================================================  
    1.{  
    2.                                    xtype : "numberfield",  
    3.                                    anchor : "70%",  
    4.                                    fieldLabel : "综合平均电价",  
    5.                                    name : "elePrice",  
    6.                                    allowNegative : false,  
    7.                                    allowBlank : true,  
    8.                                    listeners : {  
    9.                                        render : function(obj) {  
    10.                                            var font = document.createElement("font");  
    11.                                            font.setAttribute("color","black");  
    12.                                            var redStar = document.createTextNode('元/kW.h');  
    13.                                            font.appendChild(redStar);  
    14.                                            obj.el.dom.parentNode.appendChild(font);  
    15.                                        }  
    16.                                    }  
    17.                                }  
    ===================================================================================================
  • 相关阅读:
    XMEGA IO口外部中断操作
    博客开通了
    cocos2d-x CCParticleSystem粒子系统
    获得web api 返回的Dataset 绑定到网格控件上
    DbHelperSQL—— 动软生成DbHelperSQL类
    Silverlight 调用 web api
    await运算符只能用于异步方法中。请考虑用async修饰符标记此方法,并将其返回类型更改为Task
    js如何获取url的参数
    cvbfbd
    【转】selenium及webdriver的原理
  • 原文地址:https://www.cnblogs.com/FredTang/p/2765745.html
Copyright © 2011-2022 走看看