[CLOSED] Set FieldCls value on server side

  1. #1

    [CLOSED] Set FieldCls value on server side

    Hello,

    If I set up control property FieldCls on client side - it works

    If I set up property FieldCls on server side like for example:

    textFieldCity.FieldCls = "textReadOnly";
    
                comboBoxProvince.FieldCls = "textReadOnly";
    - it does not work

    ----------------------------------
    .textReadOnly {
         background: #f9f9f9;
         color: #838383;
    }
    ----------------------------------

    Please tell me what I missed?

    Thanks in advance ,
    Oleg
    Last edited by Daniil; Jun 11, 2013 at 12:30 PM. Reason: [CLOSED]
  2. #2
    Please post a simplified .aspx code sample demonstrating how to reproduce the issue. Please ensure to remove all code in your sample that is not directly related to the problem.

    We should be able to copy/paste this sample into our local test project and view in a browser without having to fix code sample errors or exceptions.
    Geoffrey McGill
    Founder
  3. #3
    Please close the thread.
    It is something wrong on my side

    Thanks!
    Last edited by omazlov; Jun 07, 2013 at 6:38 PM.
  4. #4

    Set FieldCls value on server side

    Hi guys,

    I need to reopen the case.

    There are two text fields in a sample. One read only, second not.
    When I click a button all fields become read only, but css style is not applied for Text2 field.

    Please let me know what I am doing wrong.

    Thanks in advance,
    Oleg

    Here is a sample to reproduce the issue
    <%@ Page Language="C#" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }
    
    
        protected void btnReset_Click(object sender, DirectEventArgs e)
        {
            TextField2.ReadOnly = true;
            TextField2.FieldCls = "textReadOnly";
        }
    </script>
    
    
    <!DOCTYPE html>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
        <style type="text/css">
            .textReadOnly{
            background: red;
            color: #838383;
        }
        </style>
    
    
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <ext:Window ID="Window1"
            runat="server"
            Width="250"
            Height="250"
            Title="Read Only"
            Closable="false"
            Layout="Form"
            BodyPadding="5">
            <Defaults>
                <ext:Parameter Name="LabelWidth" Value="80" />
            </Defaults>
            <TopBar>
                <ext:Toolbar ID="Toolbar1" runat="server" TabIndex="-1">
                    <Items>
                        <ext:Button ID="btnReset" runat="server" Scale="Medium" Icon="ArrowRefreshSmall" Text="All Read Only" TabIndex="-1">
                            <DirectEvents>
                                <Click OnEvent="btnReset_Click" >
                                    <EventMask ShowMask="true" Msg="Loading ..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </TopBar>
            <Items>
                <ext:TextField ID="TextField1" FieldLabel="Text1" runat="server" FieldCls="textReadOnly" ReadOnly="true">
                </ext:TextField>
    
                <ext:TextField ID="TextField2" FieldLabel="Text2" runat="server">
                </ext:TextField>
            </Items>
        </ext:Window>
        </form>
    </body>
    </html>
  5. #5
    Hi Oleg,

    For custom styling it is better to use the Cls property instead.

    TextField2.Cls = "textReadOnly";
    .textReadOnly input {
        background: red;
        color: #838383;
    }
  6. #6
    Thank you Daniil.

    It works. Please close the thread

    Oleg
  7. #7

    post mistake..

    post mistake..i can't delete..
    Last edited by gs_user; Jun 26, 2013 at 3:35 AM.

Similar Threads

  1. [CLOSED] X.msg.alert: Server side vs Client side
    By FpNetWorth in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 28, 2012, 9:17 AM
  2. Replies: 3
    Last Post: Dec 26, 2011, 1:32 PM
  3. Replies: 1
    Last Post: Dec 01, 2010, 5:14 PM
  4. Replies: 4
    Last Post: Mar 19, 2010, 11:35 AM
  5. Replies: 6
    Last Post: Sep 01, 2009, 1:06 PM

Posting Permissions