[CLOSED] Problems with NumberField after Ext.NET/ExtJS Update

  1. #1

    [CLOSED] Problems with NumberField after Ext.NET/ExtJS Update

    Hello,

    we started our project before we get to know about Ext.NET/Coolite. For this reason we are using earlier own written ExtJS Wrapper in some Webforms which we did not migrate to Ext.NET until now.

    This always worked fine (our old wrappers use the ExtJS libs in the Ext.NET Dlls) but after an SVN update of yesterday (we used an Ext.NET with ExtJS 3.2.1 before), we have problems with the Decimal Seperator of the NumberField in our own wrapper.

    The DecimalSeperator does not accept a "," (for german CultureSettings for example).

    Can anybody tell me if there have been some changes in ExtJS 3.3.0 compared to 3.2.1?


    Regards,

    Martin
    Last edited by Daniil; Sep 24, 2010 at 1:36 PM. Reason: [CLOSED]
  2. #2
    Hi macap,

    I just had a look into sources of 3.2.1 and 3.3.0 versions and didn't see any changes relating to the decimalSeparator property.

    Could you provide us with a NumberFiled's definition script which is created by your own wrapper?

    Like this:

    Example
    new Ext.form.NumberField({
                                           id:"ctl04",
                                           renderTo:"ctl04_Container",
                                           decimalSeparator:","
               });
    Also please note that we uses this fix for NumberField. Maybe it's related to this issue.

    Ext.Net fix for Number field
    Ext.form.NumberField.prototype.setValue = Ext.form.NumberField.prototype.setValue.createSequence(function (v) {
        if (this.trimTrailedZeros === false) {
            var value = this.getValue(),
                strValue;
            
            if (!Ext.isEmpty(value, false)) {
                strValue = value.toFixed(this.decimalPrecision).replace(".", this.decimalSeparator);    
                this.setRawValue(strValue);
            }
        }
    });
    Also we're overrode the getErrors method. You can get its source from the SVN:
    Ext.Net\Build\Ext.Net\extnet\core\form\NumberField.js
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi macap,

    I just had a look into sources of 3.2.1 and 3.3.0 versions and didn't see any changes relating to the decimalSeparator property.

    Could you provide us with a NumberFiled's definition script which is created by your own wrapper?

    Like this:

    Example
    new Ext.form.NumberField({
                                           id:"ctl04",
                                           renderTo:"ctl04_Container",
                                           decimalSeparator:","
               });
    Also please note that we uses this fix for NumberField. Maybe it's related to this issue.

    Ext.Net fix for Number field
    Ext.form.NumberField.prototype.setValue = Ext.form.NumberField.prototype.setValue.createSequence(function (v) {
        if (this.trimTrailedZeros === false) {
            var value = this.getValue(),
                strValue;
            
            if (!Ext.isEmpty(value, false)) {
                strValue = value.toFixed(this.decimalPrecision).replace(".", this.decimalSeparator);    
                this.setRawValue(strValue);
            }
        }
    });
    Also we're overrode the getErrors method. You can get its source from the SVN:
    Ext.Net\Build\Ext.Net\extnet\core\form\NumberField.js

    I Daniil,

    I am not able until now to provide an example, because the wrapper seems to be right. There must be a bug in the configuration.
    But this is very complex and cannot be done in a simple snippet.

    But... regarding to your setValue changes...

    Can you tell me in which SVN revision you´ve build in that bugfix?


    Regards,

    Martin
  4. #4
    Quote Originally Posted by macap View Post
    I Daniil,

    I am not able until now to provide an example, because the wrapper seems to be right. There must be a bug in the configuration.
    But this is very complex and cannot be done in a simple snippet.

    But... regarding to your setValue changes...

    Can you tell me in which SVN revision you´ve build in that bugfix?


    Regards,

    Martin
    Hi Martin,

    I can't tell the exactly date of this bug-fix at that moment but seems it was rather long ago.

    Are you sure that you cannot provide us with a simple snippet?
    I meant these steps
    1. Run a page
    2. 'View source' in a browser
    3. Find a script regarding to DateField

    Or your wrapper is configured by the way that it's impossible to get the script in a browser?
  5. #5
    Hi Daniil,

    my problem is solved. It seems that the newer Ext.NET/ExtJS version internally (raw value?) always expects values with "." as seperator, e.g. "7.5" and displays it with "7,5" if the decimal seperator is set to ",".



    Regards,

    Martin
  6. #6
    Quote Originally Posted by macap View Post
    always expects values with "." as seperator
    I'm not sure what do you mean under this.

    But seems there is no separation of logic to different separators.

    I would underline only one thing there.
    There a decimalSeparator is replaced with "." to use it as parameter for the js core parseFloat function.

Similar Threads

  1. Replies: 13
    Last Post: Jun 07, 2011, 5:45 AM
  2. [CLOSED] Problems with Hidden Field after SVN Update
    By macap in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: May 23, 2011, 11:12 AM
  3. [CLOSED] Problems after update from SVN
    By VALUELAB in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: May 05, 2011, 4:57 PM
  4. Problems with Update in Ext:Label
    By FAFNER in forum 1.x Help
    Replies: 1
    Last Post: Apr 07, 2011, 4:29 AM
  5. [CLOSED] Problems with ItemID of Tabstrip after update from SVN
    By klaus.schwarz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 12, 2010, 3:21 PM

Posting Permissions