[CLOSED] Group separator property for number field

  1. #1

    [CLOSED] Group separator property for number field

    Hi,
    How to setup separator property for number field ?
    Amount: 2 000 000; the blank space represents the group separator for this example.
    Thank you in advance.
    Last edited by Daniil; May 18, 2012 at 4:44 PM. Reason: [CLOSED]
  2. #2
    Hi,

    NumberField doesn't support formatting.

    You should use TextField to achieve the requirement.

    Hopefully, the following example helps your to start.

    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 Example</title>
    
        <script type="text/javascript">
            var format = function (field) {
                var value = field.getValue();
    
                value = Ext.util.Format.number(value.replace(/[\$]/g, ""), "0,000.00");
                value = value.replace(new RegExp(",", "g"), " ");
                field.setValue(value);
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:TextField ID="TextField1" runat="server" MaskRe="/[0-9\-\,\.]/">
                <Listeners>
                    <Change Fn="format" />
                </Listeners>
            </ext:TextField>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] PropertyGrid with property separator
    By edigital in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Oct 15, 2015, 3:52 PM
  2. [CLOSED] Number Field
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 19
    Last Post: Jul 19, 2011, 8:59 AM
  3. [CLOSED] Number Field
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 05, 2011, 12:21 PM
  4. [CLOSED] Thousand separator in number Field
    By FpNetWorth in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 28, 2010, 1:01 PM
  5. [CLOSED] How to avoid using Thousand Separator in Coolite Number Field
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 02, 2010, 8:29 AM

Tags for this Thread

Posting Permissions