Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default NumberField setValue does not shows value when using custom decimalSeparator

    NumberField setValue does not shows value when using custom decimalSeparator


    Ext version: 3.3.1

    The following repro code is quite clear:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
    <script type="text/javascript" src="extjs/adapter/ext/ext-base-debug.js"></script>
    <script type="text/javascript" src="extjs/ext-all-debug-w-comments.js"></script>
    <script type="text/javascript">
    	"use strict";
    
    	Ext.onReady(function () {
    		var numberField1 = new Ext.form.NumberField({decimalSeparator: ','});
    		numberField1.setValue(1.4);
    		var numberField2 = new Ext.form.NumberField();
    		numberField2.setValue(1.4);
    		var viewPort = new Ext.Viewport({
    			layout: 'form',
    			items:[numberField1, numberField2]
    		});
    	});
    </script>
    <title></title>
    </head>
    <body>
    </body>
    </html>

  2. #2
    Ext User
    Join Date
    Dec 2009
    Posts
    4
    Vote Rating
    0
    Xam335 is on a distinguished road

      0  

    Default


    My small help:
    It works in the 3.2.1. The fixPrecision method is the problem here. It does not recognize the value as a number because of the different decimal separator and so return an empty value back to setValue.

    (I am still unclear for me why go through this setValue method so often for one render.)

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Not seeing this problem in the current ext 3.3+ branch, so it's probably already fixed.

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default


    I've patched Ext.form.NumberField following this post. PatchedNumberField work as expected:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
    <script type="text/javascript" src="extjs/adapter/ext/ext-base-debug.js"></script>
    <script type="text/javascript" src="extjs/ext-all-debug-w-comments.js"></script>
    <script type="text/javascript">
    	"use strict";
    
    	Ext.form.PatchedNumberField = Ext.extend(Ext.form.NumberField, {
    	    setValue : function(v) {
    	    	v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(this.decimalSeparator, "."));
    	        return Ext.form.PatchedNumberField.superclass.setValue.call(this, v);
    	    }
    	});
    	Ext.reg('Ext.form.PatchedNumberField', Ext.form.PatchedNumberField);
    	
    	Ext.onReady(function () {
    		var numberField1 = new Ext.form.NumberField({id:'numberField1', decimalSeparator: ','});
    		numberField1.setValue(1.4);
    		var numberField2 = new Ext.form.NumberField({id:'numberField2'});
    		numberField2.setValue(1.4);
    		var numberField3 = new Ext.form.PatchedNumberField({id:'numberField3', decimalSeparator: ','});
    		numberField3.setValue(1.4);
    		var viewPort = new Ext.Viewport({
    			layout: 'form',
    			items:[numberField1, numberField2, numberField3]
    		});
    	});
    </script>
    <title></title>
    </head>
    <body>
    </body>
    </html>

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Location
    Modena, Italy
    Posts
    59
    Vote Rating
    1
    gianmarco is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Not seeing this problem in the current ext 3.3+ branch, so it's probably already fixed.
    Yes, as i wrote in the previous post, i think

    http://www.sencha.com/forum/showthread.php?117022

    fix the problem. Hope to have this patch in 3.3.2

Similar Threads

  1. Replies: 1
    Last Post: 4 Dec 2010, 1:55 AM
  2. [2.0??] numberfield and decimalseparator
    By kallou in forum Ext 2.x: Bugs
    Replies: 5
    Last Post: 20 Mar 2008, 5:39 AM
  3. NumberField, decimalSeparator and parseValue
    By FritFrut in forum Ext 1.x: Bugs
    Replies: 4
    Last Post: 6 Nov 2007, 11:28 AM
  4. decimalseparator in numberField
    By chaos in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 29 Aug 2007, 7:54 AM

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi