Results 1 to 2 of 2

Thread: Sum 2 numberfields value and display result into another numberfields (EXTJS MVC)

  1. #1
    Sencha User
    Join Date
    Jul 2014
    Posts
    16
    Vote Rating
    0
      0  

    Default Sum 2 numberfields value and display result into another numberfields (EXTJS MVC)

    Hello,

    I would to show sum of two numberfields value into another numberfield but i don't know how to do.

    Here is my numberfield declaration :
    HTML Code:
    {
        xtype: 'numberfield',
        labelWidth: 250,
        name: 'number1',
        fieldLabel: 'Enter first number',
        minValue: 1
    },
    {
        xtype: 'numberfield',
        labelWidth: 250,
        name: 'number2',
        fieldLabel: 'Enter Second number ',
        minValue: 1
    },
    {
        xtype: 'numberfield',
        labelWidth: 250,
        name: 'result',
        fieldLabel: 'Result  ',
        minValue: 1
    },
    When user put number1 and number2 values, i want to assign automatically the sum result at third numberfield with my controller.

    Can you help me ?

    Regards,

  2. #2
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45
    Vote Rating
    24
      0  

    Default

    Listen to change event on either field and call setValue on the third field in the event handler for each field.

    http://docs.sencha.com/extjs/4.2.0/#...r-event-change

Similar Threads

  1. Replies: 1
    Last Post: 29 May 2013, 2:31 PM
  2. Numberfields
    By MutexSystems in forum Ext: Q&A
    Replies: 2
    Last Post: 6 Feb 2013, 6:48 AM
  3. Using ',' instead of '.' in numberfields. Possible?
    By msweltzdk in forum Sencha Touch 1.x: Q&A
    Replies: 3
    Last Post: 15 Jun 2012, 2:59 PM

Tags for this Thread

Posting Permissions

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