PDA

View Full Version : Checkbox hideLabel (how to remove placeholder  )



designieure
21 Oct 2010, 4:51 AM
Dear Community,

struggling a bit with Extjs checkbox.
I use a checkbox and several other Extjs controls in a plain HTML form.
Everything works very nice, except one thing:

var draftercheck = new Ext.form.Checkbox({
id:'BehalfRegForm_drafter_flg',
hideLabel: true,
applyTo: 'BehalfRegForm_drafter_flg',
labelStyle : 'display:inline;'

});


I hoped, that hideLabel would really remove label and wrap BUT firebug shows following:
<label class="x-form-cb-label" for="BehalfRegForm_finding_admin_flg" id="ext-gen31">&nbsp;</label>

How to remove at least the &nbsp; as otherwise my form looks quite crappy:-(
Firebugs shows, that removing the &nbsp; would solve my probs.

Looking forward getting a reply.

Thx a lot in advance.

Cheers

Michael

aspxer
29 Feb 2012, 5:14 AM
It is somehow connected with so called BoxLabel
Look for this attribute and assign some style (display:none) to it or some value.

Best regards

rmichelli
2 Mar 2012, 9:37 AM
Ext.form.ComboBox boxLabel property defaults to &nbsp, which causes the label element to be created in onRender:


if(this.boxLabel){
this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel});
}

set

boxLabel: ''
and no label will be created