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.                                }  
===================================================================================================

 

相关文章:

  • 2021-09-23
  • 2021-09-17
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2021-07-04
猜你喜欢
  • 2021-09-05
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-11-18
  • 2022-01-03
  • 2021-04-24
相关资源
相似解决方案