Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7994823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:13:48+00:00 2026-06-04T14:13:48+00:00

Am developing an app which has a calculator function: for example, i have 4

  • 0

Am developing an app which has a calculator function: for example, i have 4 text-fields, when a user keys in the a number in the first field, second field and third field, the app will auto calculate and give the answer on the 4th field with out the user pressing any button.
1 + 1 + 1 = 3 the answer which is 3 is auto calculated. the code for my text-field are:

Ext.define("ikhlas.view.assetallocate", {
    extend: 'Ext.Panel',
    xtype: 'assetpanel',

    config: {
        title: 'Asset',
        iconCls: 'info',
        scrollable: true,
        styleHtmlContent: true,

        items: [{
            layout: 'hbox',
            items: [{
                html: 'Sum 1:',
                flex: 1

            }, {
                xtype: 'textfield',
                flex: 1
            }, ]

        }, {
            xtype: 'spacer',
            height: 10

        }, {
            layout: 'hbox',
            items: [{
                html: 'Sum 2:',
                flex: 1

            }, {
                xtype: 'textfield',
                flex: 1
            }, ]

        }, {
            xtype: 'spacer',
            height: 10

        }, {
            layout: 'hbox',
            items: [{
                html: 'Sum 3:',
                flex: 1

            }, {
                xtype: 'textfield',
                flex: 1
            }, ]

        }, {
            xtype: 'spacer',
            height: 10

        }, ]
    }
});

My current interface.

My controller looks like this, its still empty:

Ext.define('ikhlas.controller.SubmitController', {
    extend: 'Ext.app.Controller',

    config: {
        refs: {

        },
        control: {


        }
    },

    submitbutton: function () {

    }
});

My store and My model are all empty for now. Who can help me out set up this its really giving me a hard time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:13:49+00:00Added an answer on June 4, 2026 at 2:13 pm

    Firstly, give id property to each of your 4 textfield like this,

    xtype:' textfield',
    id: 'txtField1'
    

    and so on.
    Then,
    Add the Submit button code below your spacer,

    {
       xtype: 'button',
       text:'Submit',
       id: 'submitBtn'
    }
    

    and then, in your controller file, write like this,

    config:{
        refs:{
           submitBtn: '#submitBtn',
           txtField1: '#txtField1',
           txtField2: '#txtField2',
           txtField3: '#txtField3',
           txtField4: '#txtField4'
        },
        control:{
           submitBtn: {
               tap: 'submitBtnTapFn' 
           }
        }
    },
    
    submitBtnTapFn : function(){
       var value1 = Ext.getCmp('txtField1').getValue();
       var value2 = Ext.getCmp('txtField2').getValue();
       var value3 = Ext.getCmp('txtField3').getValue();
       var value4;
    
       value4 = value1 + value2 + value3;
       Ext.getCmp('txtField4').setValue(value4);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been developing my first Java EE app, which has a number of JPA
I'm developing the app which has input fields and whenever user enters the controll,
Im developing a app which has a user sign-up activity, there I need to
I am developing an app which has several viewControllers. The first one is MainMenu
for a client, I have been developing an app which has been tailored to
I am developing an android app in which I have to present the user
I am developing an android app which has Facebook integration in it. I have
I have an iOS app which I am developing, this app has videos which
I'm developing an app which has a large amount of related form data to
i am developing an app which has a evernote integration,everything works perfect but my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.