PDA

View Full Version : [CLOSED] Set FieldCls value on server side



omazlov
May 22, 2013, 4:59 PM
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

geoffrey.mcgill
May 22, 2013, 8:13 PM
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.

omazlov
Jun 07, 2013, 5:42 PM
Please close the thread.
It is something wrong on my side

Thanks!

omazlov
Jun 10, 2013, 12:28 PM
H (http://forums.ext.net/showthread.php?24949-CLOSED-Set-FieldCls-value-on-server-side&p=111023#post111023)i 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>

Daniil
Jun 10, 2013, 3:41 PM
Hi Oleg,

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


TextField2.Cls = "textReadOnly";


.textReadOnly input {
background: red;
color: #838383;
}

omazlov
Jun 11, 2013, 12:28 PM
Thank you Daniil.

It works. Please close the thread

Oleg

gs_user
Jun 26, 2013, 3:31 AM
post mistake..i can't delete..