Readonly Property

  1. #1

    Readonly Property

    Hi,
    I am trying to implement Data with details example in my form. I am facing problem while making controls read only specifically to Combobox, datepicker and Checkbox.

    1) If I set the combo box as readonly I can still select the value using dropdown button. Same is the case with datepicker.
    2) When I set Checkbox as readonly=true it works perfectly but when I try to set it false again it still behaves like readonly. i.e. I am unable to Check it or Uncheck it.

      <ext:FormPanel runat="server" MonitorValid="true" ID="formPanel1" HideLabel="false" LabelWidth="150" LabelAlign="Left" ButtonAlign="Center" AutoScroll="true" Height="500" Border="false">
                                    <Body>
    
    <ext:FormLayout ID="FormLayout1" runat="server" StyleSpec="padding:10">                                        
                                                <ext:ComboBox runat="server" ID="cmbAccountType" FieldLabel="Account Type" StoreID="stAccountType" DisplayField="accounttype" ValueField="accounttype" ReadOnly="true"></ext:ComboBox>
                                             </ext:Anchor>
                                             <ext:Anchor>
                                                <ext:Checkbox runat="server" FieldLabel="Active" Checked="false" ID="chkCompActive" ReadOnly="true"></ext:Checkbox>
                                             </ext:Anchor>                                        
                                             <ext:Anchor>
                                                <ext:DateField runat="server" FieldLabel="Last Inv Date" ID="dtLastInvDate" Format="dd/MM/yyyy" ReadOnly="true"></ext:DateField>
                                             </ext:Anchor>                                         
                                        </ext:FormLayout>
                                     </Body>
                                    <Buttons>
     <ext:Button runat="server" ID="btnEdit" Text="Edit">
              <Listeners>
                        <Click Handler="#{cmbAccountType}.setReadOnly(false);#{dtLastInvDate}.setReadOnly(false);#{chkCompActive}.setReadOnly(false);" />
              </Listeners>
    </ext:Button>
    </Buttons>
  2. #2
    Hello!

    Posting a sample code which we could run without any change would be the best. It would save our time and cause a faster answer for you.

    As I can see you use 0.8.x version of toolkit. Here is a quote from ExtJS 2.2 (it's used in 0.8.2) about readOnly config option for all these three controls.

    readOnly : Boolean True to mark the field as readOnly in HTML (defaults to false) -- Note: this only sets the element's readOnly DOM attribute.
    Obviously it doesn't really prevent editing in case for ComboBox and DatePicker controls.

    Generally speaking, I would highly recommend you to use the new Ext.Net 1.0. There is ExtJS 3.3 is used.
    To be brief the new version of toolkit is much better than the previous one. For example, the readOnly really works as expected in according to its name.

    Here you can download the new version
    http://forums.ext.net/showthread.php...on-1.0-Preview
  3. #3

    Solved

    Thanks Daniil.

    It worked perfectly with 1.0. Please mark it as solved.

    Regards,
    Vivek Rane

Similar Threads

  1. ReadOnly Property
    By YusufHotelwala in forum 1.x Help
    Replies: 4
    Last Post: Sep 25, 2011, 8:14 PM
  2. readonly property
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: Jan 21, 2010, 11:51 AM
  3. [CLOSED] ReadOnly property in HtmlEditor
    By methode in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Apr 01, 2009, 8:29 AM
  4. Readonly property
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 01, 2008, 5:25 PM
  5. Replies: 1
    Last Post: Nov 21, 2008, 7:10 AM

Posting Permissions