+++ /dev/null
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.form.Label\r
- * @extends Ext.BoxComponent\r
- * Basic Label field.\r
- * @constructor\r
- * Creates a new Label\r
- * @param {Ext.Element/String/Object} config The configuration options. If an element is passed, it is set as the internal\r
- * element and its id used as the component id. If a string is passed, it is assumed to be the id of an existing element\r
- * and is used as the component id. Otherwise, it is assumed to be a standard config object and is applied to the component.\r
- */\r
-Ext.form.Label = Ext.extend(Ext.BoxComponent, {\r
- /**\r
- * @cfg {String} text The plain text to display within the label (defaults to ''). If you need to include HTML \r
- * tags within the label's innerHTML, use the {@link #html} config instead.\r
- */\r
- /**\r
- * @cfg {String} forId The id of the input element to which this label will be bound via the standard HTML 'for'\r
- * attribute. If not specified, the attribute will not be added to the label.\r
- */\r
- /**\r
- * @cfg {String} html An HTML fragment that will be used as the label's innerHTML (defaults to ''). \r
- * Note that if {@link #text} is specified it will take precedence and this value will be ignored.\r
- */\r
-\r
- // private\r
- onRender : function(ct, position){\r
- if(!this.el){\r
- this.el = document.createElement('label');\r
- this.el.id = this.getId();\r
- this.el.innerHTML = this.text ? Ext.util.Format.htmlEncode(this.text) : (this.html || '');\r
- if(this.forId){\r
- this.el.setAttribute('for', this.forId);\r
- }\r
- }\r
- Ext.form.Label.superclass.onRender.call(this, ct, position);\r
- },\r
- \r
- /**\r
- * Updates the label's innerHTML with the specified string.\r
- * @param {String} text The new label text\r
- * @param {Boolean} encode (optional) False to skip HTML-encoding the text when rendering it\r
- * to the label (defaults to true which encodes the value). This might be useful if you want to include \r
- * tags in the label's innerHTML rather than rendering them as string literals per the default logic.\r
- * @return {Label} this\r
- */\r
- setText: function(t, encode){\r
- this.text = t;\r
- if(this.rendered){\r
- this.el.dom.innerHTML = encode !== false ? Ext.util.Format.htmlEncode(t) : t;\r
- }\r
- return this;\r
- }\r
-});\r
-\r
-Ext.reg('label', Ext.form.Label);
\ No newline at end of file