PDA

View Full Version : [CLOSED] V2.0 DateField background



Aurelio
Jan 15, 2012, 10:21 PM
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..
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..

3709

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

Tnks
Aurelio

geoffrey.mcgill
Jan 16, 2012, 12:46 AM
Hi,

The code you posted does not appear to reproduce the problem. When I ran the code, the DateField appears to render correctly.

Aurelio
Jan 16, 2012, 2:14 AM
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

Daniil
Jan 16, 2012, 9:44 AM
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>

Aurelio
Jan 16, 2012, 10:58 AM
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