From: Edward Date: Thu, 7 Mar 2019 02:32:43 +0000 (+0800) Subject: Roo/form/TextItem.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=dc79e18e9a0e1ee46d5ce06cc63186262ef55a8f Roo/form/TextItem.js --- diff --git a/Roo/form/TextItem.js b/Roo/form/TextItem.js index aefd1d8259..0f013551c5 100644 --- a/Roo/form/TextItem.js +++ b/Roo/form/TextItem.js @@ -22,11 +22,31 @@ Roo.form.TextItem = function(config){ }; Roo.extend(Roo.form.TextItem, Roo.BoxComponent, { - /** * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to - * {tag: "input", type: "text", size: "20", autocomplete: "off"}) + * {tag: "div", type: "text", size: "20", autocomplete: "off"}) */ defaultAutoCreate : {tag: "input", type: "text", size: "20", autocomplete: "new-password"}, + /** + * @cfg {String} tag the tag for this item (default div) + */ + tag : 'div', + /** + * @cfg {String} html the content for this item (default empty) + */ + html : '', + + getAutoCreate : function() + { + var cfg = { + tag: this.tag + } + var cfg = typeof this.autoCreate == "object" ? + this.autoCreate : Roo.apply({}, this.defaultAutoCreate); + if(this.id && !cfg.id){ + cfg.id = this.id; + } + return cfg; + }, }); \ No newline at end of file