View Full Version : How can I stop a datefield’s width being set to 0px when setReadOnly(true)?

25 Mar 2011, 6:17 AM
I have 2 datefield on a page and based on a condition I need to set the date to the current data and disable the control (setReadOnly). When the option is unselected, one of the datefield is not rendered correctlty. Looking at the css, the starting class is x-form-text x-from-field x-form-focus and style=”width: 151px”. When I set the controls to readOnly, the css class is x-form-text x-form-field x-trigger-noedit, style=”width:168px;” when the controls are set back to readOnly false, one of the controls goes back to the original css but the other has the correct class but the width, style=”width:0px”. How can I stop the width being set to 0px?