Display problem with disabled fields

  1. #1

    Display problem with disabled fields

    Hi,

    in the following example all form fields are disabled:

    <%@ Page Language="C#" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Test</title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Panel 
                ID="Panel1" 
                runat="server" 
                Title="Simple Form"
                PaddingSummary="5px 5px 0"
                Width="600"
                Frame="true"
                ButtonAlign="Center"
                Layout="Form">
                <Items>
                    <ext:TextField
                        ID="Username"
                        runat="server"
                        Disabled="true"
                        DataIndex="Username"
                        FieldLabel="Username"
                        MaxLength="40"
                        AnchorHorizontal="100%" />
                    <ext:SelectBox
                        ID="cboSex"
                        runat="server" 
                        Disabled="true"
                        DataIndex="Sex"
                        HiddenName="Sex"
                        FieldLabel="Sex"
                        Editable="false"
                        TypeAhead="true"
                        EmptyText="....."
                        AnchorHorizontal="100%"
                        ColumnWidth=".50">
                        <Items>
                            <ext:ListItem Text="Male" Value="M" />
                            <ext:ListItem Text="Female" Value="F" />
                        </Items>
                    </ext:SelectBox>
                    <ext:Container ID="DummyContainer77" runat="server" Layout="Column" Height="27">
                        <Items>
                            <ext:DateField
                                ID="LoginExpirationDate" 
                                runat="server"
                                Disabled="true"
                                DataIndex="LoginExpirationDate"
                                Format="dd/MM/yyyy"
                                FieldLabel="Expiration"
                                AnchorHorizontal="100%"
                                ColumnWidth=".36" />
     
                            <ext:Label ID="Label6" runat="server" ColumnWidth=".035" />
     
                            <ext:TextField
                                ID="AllowedAccessFromIP"
                                runat="server"
                                Disabled="true"
                                DataIndex="AllowedAccessFromIP"
                                FieldLabel="Enabled IP"
                                LabelWidth = "75"
                                MaxLength="40"
                                AnchorHorizontal="100%"
                                ColumnWidth=".37" />
                            <ext:Label ID="Label7" runat="server" ColumnWidth=".035" />
                            <ext:CheckBox
                                ID="IsDisabled"
                                runat="server"
                                Disabled="true"
                                DataIndex="IsDisabled" 
                                FieldLabel="Disabled"
                                LabelWidth="103"
                                ColumnWidth=".20" />
                        </Items>
                    </ext:Container>
                </Items>
            </ext:Panel>
        </form>
    </body>
    </html>
    You can see in the attached image that while the field labels in the third row are grayed-out, those of the first and second row are not.
    I think the problem is due to the fact that the fields of the third row are contained in a container.

    Bye,
    Stefano
  2. #2
    Hello!

    Yes, you are right. It happens because of there is a Container.
    To work it around please use the DisabledClass property for the controls where the FieldLabels are gray.

    Example
    ...
    <head runat="server">
        <title>Ext.Net Example</title>
        <style type="text/css">
            .myDysabledClass {
                color: black;
            }
        </style>
    </head>
    ...
    <ext:DateField
        ID="DateField1"
        runat="server"
        Disabled="true"
        FieldLabel="FieldLabel"
        DisabledClass="myDysabledClass"/>
  3. #3
    Hi Daniil,

    thanks, your solution works fine.

    Will I find it in next SVN update or it is a by design implementation?

    Bye,
    Stefano
  4. #4
    I think we should fix this in the svn source. I am investigating...
    Geoffrey McGill
    Founder
  5. #5
    A new ticket was created for this, see

    http://extnet.lighthouseapp.com/proj...plugin-is-used

    We should have fixed soon. Once fixed, the above work-around will not be required.
    Geoffrey McGill
    Founder
  6. #6
    Just out of interests sake, the following css classes will work-around the problem globally.

    Example

    <style type="text/css">
        .x-item-disabled {
            opacity : 1.0 !important;
        }
        
        .x-item-disabled .x-form-item-label {
            color : #000 !important;
        }
    </style>
    Geoffrey McGill
    Founder

Similar Threads

  1. Display combine fields in gridpanel
    By Vaishali in forum 1.x Help
    Replies: 3
    Last Post: Feb 06, 2012, 3:39 AM
  2. Replies: 0
    Last Post: Oct 27, 2011, 10:02 PM
  3. [CLOSED] Problem with editable fields in group
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 11, 2011, 7:07 PM
  4. Replies: 7
    Last Post: Aug 12, 2009, 4:04 PM
  5. Replies: 0
    Last Post: May 07, 2009, 9:38 PM

Posting Permissions