4 * @extends Roo.form.Layout
5 * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet
6 * Creates a row container for layout and rendering of fields in an {@link Roo.form.Form}.
8 * @param {Object} config Configuration options
12 Roo.form.Row = function(config){
13 Roo.form.Row.superclass.constructor.call(this, config);
16 Roo.extend(Roo.form.Row, Roo.form.Layout, {
18 * @cfg {Number/String} width
19 * The fixed width of the column in pixels or CSS value (defaults to "auto")
22 * @cfg {Number/String} height
23 * The fixed height of the column in pixels or CSS value (defaults to "auto")
25 defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-row'},
29 onRender : function(ct, position){
30 //console.log('row render');
32 var t = new Roo.Template(
33 '<div class="x-form-item {5}" style="float:left;width:{6}px">',
34 '<label for="{0}" style="{2}">{1}{4}</label>',
35 '<div class="x-form-element" id="x-form-el-{0}" style="{3}">',
39 t.disableFormats = true;
41 Roo.form.Layout.prototype.rowTpl = t;
43 this.fieldTpl = this.rowTpl;
45 //console.log('lw' + this.labelWidth +', la:' + this.labelAlign);
48 if ((this.labelAlign != 'top')) {
49 if (typeof this.labelWidth == 'number') {
50 labelWidth = this.labelWidth
52 this.padWidth = 20 + labelWidth;
56 Roo.form.Column.superclass.onRender.call(this, ct, position);
58 this.el.setWidth(this.width);
61 this.el.setHeight(this.height);
66 renderField : function(f){
67 f.fieldEl = this.fieldTpl.append(this.el, [
69 f.labelStyle||this.labelStyle||'',
70 this.elementStyle||'',
71 typeof f.labelSeparator == 'undefined' ? this.labelSeparator : f.labelSeparator,
72 f.itemCls||this.itemCls||'',
73 f.width ? f.width + this.padWidth : 160 + this.padWidth