View Full Version : [INVALID] CheckBox BoxLabel?

Jun 19, 2008, 4:39 PM
Are you going to support text beside a checkbox?

Currently using:

<ExtJS:Checkbox runat="server" FieldLabel="Word?" Checked="True" />

Would expect it to render the check box with 'Word?' beside it.


Jun 19, 2008, 5:44 PM
Hi Timothy,

The FieldLabel property is a feature that will get applied by default once the <ext:FormPanel> control has been built. I had kind of just put off implementing the label feature for use outside of a FormPanel, but I take another look later today and see if we can build it in. This would be a helpful feature to have across the board.

Thanks for pointing out the missing functionality.

Jun 20, 2008, 11:59 AM
Would you have another recommendation for having text beside a checkbox field?


Jun 24, 2008, 6:43 AM
Hi Timothy,

The following sample demonstrates a couple options for adding a Label to the Checkbox.

http://sandbox.ext.net/Form/Checkbox/ (http://sandbox.ext.net/Form/Checkbox)

By default the Checkbox is a block-level element which will wrap any adjacent text onto the next line. By setting the x-form-check-wrap Css style to "display:none;", the Checkbox is forced into an inline element.


<style type="text/css">
.x-form-check-wrap { display: inline; }

The sample also demonstrate a couple techniques for adding a "Check" Listener to the Checkbox.

Toolkit v0.5.3 or higher is required for the above sample.

Hope this helps.