[CLOSED] V2.0 DateField background

  1. #1

    [CLOSED] V2.0 DateField background

    Hi, i have this problem whit the DateField component..TextField work OK:

    CSS
    .txtObbligatorioDate
        {
            background: #FDFCD9;               
        }
    Property: FieldCls="txtObbligatorioDate"
    <ext:DateField ID="DateFieldSceConDatIni" runat="server" FieldLabel="Data inizio" AllowBlank="false"
                                                Width="300" Margins="0 3 0 0" FieldCls="txtObbligatorioDate">
                                                <ToolTips>
                                            <ext:ToolTip ID="ToolTipSceConDatIni" runat="server" Title="Data inizio" 
                                            Width="150" Html="Data inizio periodo contabile." />
                                        </ToolTips>
                                            </ext:DateField>
    The button of the datePicker appear to left..
    Click image for larger version. 

Name:	Img01.png 
Views:	135 
Size:	952 Bytes 
ID:	3708

    if leave FieldCls:

    <ext:DateField ID="DateFieldSceConDatIni" runat="server" FieldLabel="Data inizio" AllowBlank="false"
                                                Width="300" Margins="0 3 0 0">
                                                <ToolTips>
                                            <ext:ToolTip ID="ToolTipSceConDatIni" runat="server" Title="Data inizio" 
                                            Width="150" Html="Data inizio periodo contabile." />
                                        </ToolTips>
                                            </ext:DateField>
    It appear correctly..

    Click image for larger version. 

Name:	Img02.png 
Views:	137 
Size:	1,017 Bytes 
ID:	3709

    The problem only affects the display because the control works properly...

    Tnks
    Aurelio
    Last edited by Daniil; Jan 16, 2012 at 8:47 AM. Reason: [CLOSED]
  2. #2
    Hi,

    The code you posted does not appear to reproduce the problem. When I ran the code, the DateField appears to render correctly.
    Geoffrey McGill
    Founder
  3. #3
    Hi, i reproduced the error in the reduced form because the original code is long, from here you get the case mentioned. The second datafield (data fine) have the button picker a left

     <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ARWebRevolution.WebForm1" %>
    
    <%@ 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 runat="server">
        <title></title>
        <style type="text/css">
    .txtObbligatorioDate
        {
            background: #FDFCD9;               
        }
    </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <div>        
                                   
                                    <ext:TextField ID="txtSceConDes" runat="server" AllowBlank="false" MarginSpec="40 0 3 5"
                                        BlankText="*Obbligatorio" FieldLabel="Descrizione" FieldCls="txtObbligatorio"
                                        MaxLength="80" MaxLengthText="*Massimo 80 caratteri." AnchorHorizontal="98%">
                                        <ToolTips>
                                            <ext:ToolTip ID="ToolTipSceConDes" runat="server" Title="Scenario" Width="150" Html="Descrizione scenario contabile." />
                                        </ToolTips>
                                    </ext:TextField>
                                    
                                            <ext:DateField ID="DateFieldSceConDatIni" runat="server" FieldLabel="Data inizio" AllowBlank="false"
                                                Width="200" LabelWidth="90" >
                                                <ToolTips>
                                            <ext:ToolTip ID="ToolTipSceConDatIni" runat="server" Title="Data inizio"
                                            Width="150" Html="Data inizio periodo contabile." />
                                        </ToolTips>
                                            </ext:DateField>
                                             <ext:DateField ID="DateFieldSceConDatFin" runat="server" FieldLabel="Data fine" AllowBlank="false"
                                                Width="170" LabelWidth="60"  MarginSpec="0 0 0 30" FieldCls="txtObbligatorioDate">
                                                <ToolTips>
                                            <ext:ToolTip ID="ToolTipSceConDatFin" runat="server" Title="Data fine"
                                            Width="150" Html="Data fine periodo contabile." />
                                        </ToolTips>
                                            </ext:DateField>
                                       
                                
        </div>
        </form>
    </body>
    </html>
    I resolve the problem: for the dataField the FieldCls="txtObbligatorioDate" create the problem, but FieldStyle="background: #FDFCD9;" for the dataField work fine.. is the opposite of the textField.. :)

    Thank you for your patience

    Aurelio
  4. #4
    Hi,

    Confirmed. Your custom FieldCls overrides the default one.

    I would suggest you to set up the Cls property instead of the FieldCls one.

    Example
    <%@ 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 runat="server">
        <title>Ext.NET v2 Example</title>
        <style type="text/css">
            .my-dateField INPUT {
                background-color: #FDFCD9;
                background-image: none;
            }
        </style>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:DateField 
            runat="server" 
            Cls="my-dateField" />
    </body>
    </html>
    Last edited by Daniil; Jan 16, 2012 at 8:47 AM.
  5. #5
    Hi Daniil

    Great it work,

    Not working

    .txtObbligatorioDate
        {
            background-color: #FDFCD9;
                background-image: none;              
        }
    Work fine

    .txtObbligatorioDate INPUT
        {
           background-color: #FDFCD9;
                background-image: none;             
        }
    i don't specified the INPUT after the name of css and it was not working properly

    Thanks for your help
    Last edited by Daniil; Jan 16, 2012 at 10:00 AM. Reason: Please use [CODE] tags

Similar Threads

  1. [CLOSED] V2.0 TextField background
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 16, 2012, 8:46 AM
  2. [CLOSED] BackGround TextField
    By majunior in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 19, 2011, 6:48 PM
  3. [CLOSED] [1.0] gridpanel set row's background-color
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 10, 2010, 12:37 PM
  4. [CLOSED] menu background
    By alexp in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 02, 2009, 1:51 PM
  5. Change Tab background color or background image
    By georgelanes in forum 1.x Help
    Replies: 0
    Last Post: Nov 06, 2008, 3:55 PM

Posting Permissions