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 8338821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:42:40+00:00 2026-06-09T04:42:40+00:00

There are 2 buttons on a Ext.WIndow . When i click on the Button

  • 0

There are 2 buttons on a Ext.WIndow. When i click on the Button 1, the following code get executed.

When i click on the Button 2, the second set of the code gets executed. Both these buttons will load from the Store

The problem;

When i click on the 1st Button, The following console.log statements gets printed (Which is the way i expected)

console.log ('win 1');
console.log('Came win 1');

After this when i click on the 2nd Button, I get the incorrect console.log gets displayed.

console.log ('win 2');
console.log('Came win 1'); // Which is coming from the 1st Buttons Load function.

Button 1

        var personCus= Ext.getStore('Person');
        var record = personCus.getAt(0);
    console.log ('win 1');
    personCus.on('load', function() {
console.log('Came win 1');
        var label= Ext.ComponentQuery.query('#win1> #labido')[0];
        label.setText(record1.get('id'));
}

Button 2

        var personCus= Ext.getStore('Person');
        var record = personCus.getAt(0);
    console.log ('win 2');
    personCus.on('load', function() {
console.log('Came win 3');
        var label= Ext.ComponentQuery.query('#win2> #labid1')[0];
        label.setText(record1.get('id'));
}
  • 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-09T04:42:41+00:00Added an answer on June 9, 2026 at 4:42 am

    I think majority of your issue is simply because you’re subscribing to the load event several times. Basically when you execute Button2 code – store will have two handlers for load even and they will run both.

    Usually when you subscribe to the load event you want to add { single: true } option, so the handler will get called once and will be removed from the store.

    store.on('load', 
       function() {...},  
       scope /* this or something like it... */,
       { single: true }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to get the Ext.menu and/or the Ext.Button components used for
Assuming there are buttons with all the letters from the alphabet set as Text.
In my application I have some link buttons there but when I right click
there are some buttons on the top of the winform, and when I click
I have a window which opens up on a button click. The window takes
On Click of a button, opens a window in which i have a form
I defined an Ext.window and there is a form inside it,and form contains a
I have following code which is not working on sencha touch 2, is there
guys: There is two buttons in my viewController of test app, the right one
In my application - there are four buttons named as follows: Top - left

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.