Results 1 to 2 of 2

Thread: how set a variable MaxValue

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Trinacria - Italy
    Posts
    35

    Default how set a variable MaxValue

    my form has two numberfields:
    Code:
    var fc0 = new Ext.form.NumberField({
          xtype : 'numberfield'
        ,fieldLabel : 'fc0'
        ,name: 'fc0'
        ,allowBlank : false
        ,decimalPrecision : 2
        ,minValue : 0
    });
    
    var fcu = new Ext.form.NumberField({
         xtype : 'numberfield'
        ,fieldLabel : 'fcu'
        ,name: 'fcu'
        ,allowBlank : false
        ,decimalPrecision : 2
        ,minValue : 0
        ,maxValue : fc0.getValue()
    });
    I'd want to set the maxValue of fcu equal to the value of fc0 digited by the user.
    The script above does not work. How can do it?

    thank u!

  2. #2
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750

    Default

    Add a blur listener to fc0 and use fcu.setMaxValue() within it. Something like:

    Code:
     
    var fc0 = ....
      listeners: {
        'blur': function(field)
        {
          fcu.setMaxValue(fc0.getValue());
        }
      }
    });

Similar Threads

  1. maxValue having variable for value in Designer
    By toole1 in forum Ext Designer: Help & Discussion
    Replies: 2
    Last Post: 17 Jan 2011, 4:14 AM
  2. Replies: 7
    Last Post: 9 Apr 2009, 10:17 AM
  3. Replies: 7
    Last Post: 9 Apr 2009, 10:17 AM
  4. maxValue + better maxText
    By wlee in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 13 Jan 2009, 11:32 AM

Posting Permissions

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