Results 1 to 4 of 4

Thread: [CLOSED][3.??] Problem with NumberField as Grid Editor

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Feb 2008
    Posts
    15
    Vote Rating
    0
      0  

    Default [CLOSED][3.??] Problem with NumberField as Grid Editor

    Here is the situation which results in a bug :

    Have a grid with editor of a column as NumberField with allowDecimals as false.

    Code:
    {
        xtype : "editorgrid",
        columns: [ {
              header: 'foo',
              editor: new Ext.form.NumberField({allowDecimals: false})
         }]
    ]
    }
    Now type "4.5" in that column and if you wait, the 'keyup' event on TextField calls validate method on Field; which corrects "4.5" to "45".

    But if we tabout just after typing "4.5" (without giving time for keyup event), Editor's completeEdit is called which eventually sets the value "4.5" in record.

    Note: Though allowDecimals is false, isValid method on NumberField does not verify this.

    After compleEdit, the 'blur' event is called on TextField which corrects "4.5" to "45" but its too late. Record has already been updated with "4.5".

    Issues:
    I found two issues here -

    1. NumberField's validateValue does not validate for allowDecimals property.

    2. Even if we fix this issue, there would be a scenario where processValue on TextField is not called and characters to be stripped (stripCharsRe) are not removed.


    Solution:
    1. validateValue of NumberField should verify allowDecimals.

    2. Provide a getValue method on TextField which would invoke processValue.
    Code:
    getValue: function() {
        var v = Ext.form.TextField.superclass.getValue.call(this);
        return this.processValue(v);
    }

  2. #2
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    are you sure this is a problem in 3.0?
    cos the decimal isn't even allowed through in both 3.0rc1 and the 2.x svn branch.
    plus there's no private stripCharsRe variable in the initEvents() method in both 3.0 and 2.x svn.

    i believe you're still on the official 2.2.1 release, no?

  3. #3
    Ext User
    Join Date
    Feb 2008
    Posts
    15
    Vote Rating
    0
      0  

    Default

    Its my mistake, wrong forum. We are in 2.2.1 version, waiting for final 3.0 release. Will this fix be available in 2. release?

  4. #4
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    Quote Originally Posted by mystix View Post
    cos the decimal isn't even allowed through in both 3.0rc1 and the 2.x svn branch.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •