1. #11
    Sencha User realjax's Avatar
    Join Date
    Aug 2009
    Location
    Netherlands
    Posts
    412
    Vote Rating
    6
    realjax is on a distinguished road

      0  

    Default


    Quote Originally Posted by Allbus View Post
    But findField() has the same result of getCmp()
    That's because you gave the field an ID. I haven't buil;t in support for ID's. Remove it , use findField with name = 'demo2' and problem fixed.
    Quote Originally Posted by Allbus View Post
    The point is that form.getValues() doesn't call getValue() on each field.
    use form.getFieldValues() then..

  2. #12
    Ext Premium Member
    Join Date
    May 2010
    Posts
    18
    Vote Rating
    0
    MarkusL is on a distinguished road

      0  

    Question


    Hi!

    There are two problems with v02 of the plugin:
    • values larger than 999999 don't work. When editing or during getValues() only ONE thousands separator is removed. Result: 1.000.500,50 € => 1000.500.50 which is obviously not a valid floating point value.
    • setValues() does not work using JSON floating point values. If 1000.5 is stored in the database the plugin formats the value to 10005,00 - ignoring the "."

  3. #13
    Ext User
    Join Date
    Oct 2010
    Location
    Kertosono
    Posts
    1
    Vote Rating
    0
    firdefex is on a distinguished road

      0  

    Default


    Quote Originally Posted by MarkusL View Post
    Hi!

    There are two problems with v02 of the plugin:

    • values larger than 999999 don't work. When editing or during getValues() only ONE thousands separator is removed. Result: 1.000.500,50 € => 1000.500.50 which is obviously not a valid floating point value.
    see formatHiddenValue, just replace

    rawAmount = String(rawAmount).replace(this.currencyConfig.thousandsSeparator,'');

    with this one

    var replacer = RegExp(this.currencyConfig.thousandsSeparator,'g');
    rawAmount = String(rawAmount).replace(replacer,'');

    'g' is for global search and replace

    use the same way for cleanForEdit as well

  4. #14
    Ext Premium Member
    Join Date
    May 2010
    Posts
    18
    Vote Rating
    0
    MarkusL is on a distinguished road

      0  

    Default


    Thanks for your help, but you have to escape the thousandsSeparator to get a valid regexp:

    PHP Code:
    var replacer = new RegExp('\\'+this.currencyConfig.thousandsSeparator,'g'); 

  5. #15
    Ext User
    Join Date
    Jan 2011
    Posts
    2
    Vote Rating
    0
    jumping jack is on a distinguished road

      0  

    Default it's pretty good , but useless

    it's pretty good , but useless


    Hi, I've tried your methods, but 'replacers' didn't help neither of firdefex nor MarkusL. In Edit mode number stays with one comma (thousandsSeparator).
    What I find even worse - that I cannot get this value without format-signs - for example, I want to get it's value and make some arithmetic and write result down in other field: neither getForm.findfield("demo") nor getCmp("id_demo") nor smth. else helps.
    Only if I send whole form, I can see in getForm().getValues(true) it's right Number value - without currency format.
    Maybe somebody knows, whether it's possible to get some kind key/values or some kind of getField from getForm().getValues(true) or you know other solution ? Thank you !

  6. #16
    Ext JS Premium Member
    Join Date
    Jul 2010
    Posts
    12
    Vote Rating
    0
    ericsmith66 is on a distinguished road

      0  

    Default Bug with submited value when nothing is entered in currency field

    Bug with submited value when nothing is entered in currency field


    FYI:

    It appear that submitted value of currency field is 'undefined' if no value is entered (field is blank).
    We changed line 79 of currency plugin to:
    Code:
    return '';
    from:
    Code:
    return;
    That fixed the problem.

  7. #17
    Sencha User
    Join Date
    Sep 2009
    Posts
    2
    Vote Rating
    0
    fourbrain is on a distinguished road

      0  

    Default


    This is an absolutely amazing plugin. Works perfect. Thanks so much, saved me a lot of time and made our excel users so happy

  8. #18
    Sencha User
    Join Date
    Sep 2009
    Posts
    2
    Vote Rating
    0
    fourbrain is on a distinguished road

      0  

    Default


    Quote Originally Posted by jumping jack View Post
    What I find even worse - that I cannot get this value without format-signs - for example, I want to get it's value and make some arithmetic and write result down in other field: neither getForm.findfield("demo") nor getCmp("id_demo") nor smth. else helps.
    Only if I send whole form, I can see in getForm().getValues(true) it's right Number value - without currency format.
    Maybe somebody knows, whether it's possible to get some kind key/values or some kind of getField from getForm().getValues(true) or you know other solution ? Thank you !

    Code:
    alert( Ext.getCmp('demofield').hiddenField.dom.value ) ;
    ...works fine for me. I get the raw value, no matter if i use name and / or id for the field.

  9. #19
    Sencha User
    Join Date
    Apr 2012
    Posts
    1
    Vote Rating
    0
    RayD is on a distinguished road

      0  

    Default


    Great plugin. Can you create a Sencha Touch 2 version as well?

  10. #20
    Touch Premium Member
    Join Date
    Jan 2008
    Location
    Quebec, Canada
    Posts
    122
    Vote Rating
    1
    nbourdeau is on a distinguished road

      0  

    Default


    What about an Ext 4.x version ??

Similar Threads

  1. Currency / money field with selectable currency
    By simplessus in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 22 Jan 2011, 3:24 AM
  2. Personnal composite for currency field
    By Kirua007 in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 23 Apr 2010, 4:34 AM
  3. [EXTJS 3.0.0] Currency Field Component : Setting value via Javascript
    By JSCoder in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 8 Jan 2010, 1:39 AM
  4. Number Field with currency formatting
    By JSCoder in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 Sep 2009, 9:39 AM
  5. How to format numeric field in form as US currency
    By dlbjr in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 12 Feb 2008, 12:05 PM

Thread Participants: 8