Jan 09, 2014, 8:57 AM
[CLOSED] Numberfield with separator returns min value when number with separator added
Hi
I have some troubles figuring this one out. I am sure it is just a little error in the config but I can't figure it out on my own. In the following example please insert once a number without a separator (returns the number) and once a number with the separator "." (returns min value) and click on the button.
Thank you.
I have some troubles figuring this one out. I am sure it is just a little error in the config but I can't figure it out on my own. In the following example please insert once a number without a separator (returns the number) and once a number with the separator "." (returns min value) and click on the button.
Thank you.
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
NumberField nfield = new NumberField
{
ID = "nfDouble",
FieldLabel = "enter double",
AllowDecimals = true,
DecimalSeparator = ".",
AllowBlank = false,
EmptyText = "needed",
HideTrigger = true
};
this.Form.Controls.Add(nfield);
}
}
[DirectMethod]
public void showNumber()
{
X.Msg.Alert("double", X.GetCmp<NumberField>("nfDouble", new NumberField.Config() { AllowDecimals = true, DecimalSeparator = "." }).Number.ToString()).Show();
}
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" Locale="de-CH" />
<ext:Button runat="server" Text="show number" Handler="App.direct.showNumber();"></ext:Button>
</form>
</body>
</html>
Last edited by Daniil; Jan 17, 2014 at 3:50 PM.
Reason: [CLOSED]