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

  • SEARCH
  • Home
  • 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 6876203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:26:53+00:00 2026-05-27T04:26:53+00:00

I’m instantiating a class when a button is clicked. How do I get a

  • 0

I’m instantiating a class when a button is clicked. How do I get a reference to this class instance outside of the button callback?

handler: function() {
    var formValues = Ext.getCmp('DonateItemForm').getValues(),
        itemDetails = Ext.create('App.model.ItemDetails', formValues);
}

Edit: Without using a global

  • 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-05-27T04:26:54+00:00Added an answer on May 27, 2026 at 4:26 am

    You should store the model instances in the controller that manages your panel(view).
    However, if you are not coding according to the model-view-controller pattern, then you can attach it to the donate form:

    Ext.getCmp('DonateItemForm').itemDetails = itemDetails;
    

    But the basic idea should be clear:
    Every time you want to access the model instance, just go through the object that manages it (either the form controller or the form itself).

    [edit]

    To store your data in the controller, you need to first send it to that controller:

    Basically, your handler should send the data to your controller by dispatching a message to it. The message will contain the payload that contains the form data you want to send.

    handler: function() {
        var formValues = Ext.getCmp('DonateItemForm').getValues();
        var itemDetails = Ext.create('App.model.ItemDetails', formValues);   
    
        Ext.dispatch({
            controller: "YourController",
            action: 'MethodOnYourController',
            yourDetails: itemDetails
        });
    }
    

    “yourDetails” will now hold the itemDetails that you need. Of course you can name it anything you want and you can add more members to the dispatched message if you like.

    Now you need to make a method called “MethodOnYourController” that can catch this event:

    YourController = Ext.extend(Ext.Controller, {
        MethodOnYourController: function(options)
        {
            this.itemDetails = options.yourDetails; // get the "yourDetails" that you added and store it in this controller
        }
    });
    

    I haven’t tested this code, but the idea should be pretty clear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I

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.