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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:13:13+00:00 2026-05-26T19:13:13+00:00

I have this struct: Example.Form = Ext.extend(Ext.form.FormPanel, { // other element , onSuccess:function(form, action)

  • 0

I have this struct:

Example.Form = Ext.extend(Ext.form.FormPanel, {
// other element

 , onSuccess:function(form, action) {
 }

}
Ext.reg('exampleform', Example.Form);

Ext.onReady(function() {
            var win = new Ext.Window({
                id:'formloadsubmit-win'
                ,items:{id:'add', xtype:'exampleform'}
            });
            win.show();
})

I delete extra code above…

I want to do this: when I submit form on function-> onSuccess in Example.Form class able to close window on body. (When success results were submited and than the body of the window that opens become closed)

I apologize for my bad English.

  • 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-26T19:13:14+00:00Added an answer on May 26, 2026 at 7:13 pm

    The structure of the code should allow a place to store the components you are registering as xtypes. It should also have a top level namespace for the components that make up the app. This way you can always reference the parts of your app. It is also a good idea to break out the controller logic. For a small app, a single controller may work fine but once the app grows it is good to have many controllers for the app, one for each piece.

    Here is a modified version of the code you put in that example. It will handle the success event and is structured to fit the recommendations noted above.

        Ext.ns('Example');
        /* store components to be used by app */
        Ext.ns('Example.lib');
        /* store instances of app components */
        Ext.ns('Example.app');
    
        Example.lib.Form = Ext.extend(Ext.form.FormPanel, {
        // other element
    
         // moved to app controller
         //onSuccess:function(form, action) {
         //}
    
        });
    
        Ext.reg('exampleform', Example.lib.Form);
    
        Example.lib.FormWindow =  Ext.extend(Ext.Window,{
            initComponent: function(){
                /* add the items */
                this.items ={itemId:'add', xtype:'exampleform'};
    
                /* ext js requires this call for the framework to work */
                Example.lib.FormWindow.superclass.initComponent.apply(this, arguments);
            }
        });
    
        Ext.reg('exampleformwin', Example.lib.FormWindow);
    
        /*
            manage/control the app
        */
        Example.app.appController = {
            initApp: function(){
                Example.app.FormWindow = Ext.create({xtype:'exampleformwin', id:'formloadsubmit-win'});
                Example.app.FormWindow.show();
    
                /* get a reference to the 'add' form based on that item id and bind to the event */
                Example.app.FormWindow.get('add').on('success', this.onAddFormSuccess, this );
    
            },
    
            /* the logic to handle the add-form's sucess event */
            onAddFormSuccess: function(){
                Example.app.FormWindow.hide();
            }
    
        }
    
        Ext.onReady(function() {
            /* start the app */
            Example.app.appController.initApp()
        })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, I have a struct which is something like this: struct Test {
For example, I have this structure and code: typedef struct { long long *number;
I have this very simple example that I am using to learn structs in
I have this struct: struct Map { public int Size; public Map ( int
I have this struct; #define BUFSIZE 10 struct shared_data { pthread_mutex_t th_mutex_queue; int count;
I have this code struct Student { char name[48]; float grade; int marks[10,5]; char
I have this routine that calculates the seconds-to-date for a struct tm . On
Ok so I have struct like this typedef struct { float x; float y;
I have this code (C#): using System.Collections.Generic; namespace ConsoleApplication1 { public struct Thing {
I have a large number of instances of a C structure like this: struct

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.