[CLOSED] add parenthesis in numberfield

  1. #1

    [CLOSED] add parenthesis in numberfield

    in a NumberField you can put a parenthesis when the number is negative in an onblur event? or have any property to do that?
    Last edited by Daniil; Apr 09, 2011 at 1:00 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please look at the example.

    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, value) {
                value = parseInt(value);
                field.setValue(new String(value >= 0 ? value : "-(" + (-value) + ")"));
            }
        </script>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:TextField runat="server" MaskRe="/[0-9\-\$\.]/" Text="-10">
            <Listeners>
                <AfterRender Handler="format(this, this.getValue());" />
                <Change Handler="format(this, newValue);" />
            </Listeners>
        </ext:TextField>
        </form>
    </body>
    </html>
  3. #3

    Thousands

    is there any property to Thousands "." . For a control NumberField? Is there any way? What is the code to do this?
  4. #4

    align value

    excuse. how to align the value in control NumberField
  5. #5
    Quote Originally Posted by rnfigueira View Post
    is there any property to Thousands "." . For a control NumberField? Is there any way? What is the code to do this?
    Well, you could achieve this requirement in the same way that I demonstrated in the example with TextField.

    There is no way to achieve it in NumberField.
  6. #6
    Quote Originally Posted by rnfigueira View Post
    excuse. how to align the value in control NumberField
    Please set Cls="my-class" for NumberField.
    <style type="text/css">
        .my-class {
            text-align: center;
        }
    </style>
  7. #7

    NumberField

    I know but I can not NumberField. I do not know why. Try a test using a NumberField

Similar Threads

  1. [CLOSED] numberfield
    By majestic in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jul 05, 2012, 1:09 PM
  2. [CLOSED] [1.0] NumberField
    By alliedwallet.com in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 28, 2010, 7:15 PM
  3. [CLOSED] NumberField +/- with $
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 25, 2010, 10:31 PM
  4. [CLOSED] NumberField
    By majestic in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 16, 2010, 8:14 PM
  5. [CLOSED] [1.0] NumberField
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 07, 2010, 2:35 PM

Tags for this Thread

Posting Permissions