PDA

View Full Version : [CLOSED] TextField align with StyleSpec



supera
Jan 24, 2012, 12:21 PM
In version 1.x, I used a stylespec to align the text in textfield with the code bellow... and this code works very fine...



<ext:TextField runat="server" ID="txtMulta" FieldLabel="Multa (%)" Text="0,00" MaxLength="10" StyleSpec="text-align:right" EnableKeyEvents="true" X="320" Y="50" Width="85px">


But, after a upgrade the ext.net to 2.x, the LABEL of field is align to right, and the text still left-aligned.

3756

I believe it may have changed the way to do this aligment... any help?

Daniil
Jan 24, 2012, 3:45 PM
Hi,

Confirmed, it won't work in v2 anymore.

The two possible solutions are below.

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-text-field input.x-form-text {
text-align: right;
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:TextField runat="server" Text="Hello World!" FieldStyle="text-align: right;" />
<ext:TextField runat="server" Text="Hello World!" Cls="my-text-field" />
</form>
</body>
</html>

supera
Jan 24, 2012, 3:56 PM
Hi Daniil

Thanks for your response

Using FieldStyle="text-align: right;" , works fine...

Thanks a lot