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.                                }  
    ===================================================================================================
  • 相关阅读:
    js获取页面传递过来的值
    pdf生成
    行内元素和块级元素有哪些
    Relative 定位与Absolute 定位实例
    rsync全网备份
    nginx1.15.8源码安装
    网页内容抓取工具、利用多线程
    正则表达式获取HTML标记中的内容。(注:如果内容中含有回车符,请查看第三个例子)
    SQL用一个表的数据更新另一个表的数据
    将Winform编译成DLL供C/S程序引用(Winform引用Winform)
  • 原文地址:https://www.cnblogs.com/FredTang/p/2765745.html
Copyright © 2011-2022 走看看