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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:51:51+00:00 2026-06-04T16:51:51+00:00

I have several tabs on toolbar each of them having seperate handler , i

  • 0

I have several tabs on toolbar each of them having seperate handler , i have called seperate function of each handler . The code is as below

Ext.define('myco.view.User', {
    extend: 'Ext.Container',
    config: {
        scrollable: true,
        items: [{
                xtype: 'panel',
                id: 'User'
            },

            {
            docked: 'top',
            xtype: 'toolbar',
            items: [{
                text: 'My Profile',
                handler: function() {
                    var panel = Ext.getCmp('User'),
                        tpl = new Ext.XTemplate([
                        '<div class="demo-weather">',
                            '<tpl for=".">',
                                '<div class="day">',
                                    '<div class="date">{username}</div>',
                                    '<tpl for="weatherIconUrl">',
                                        '<img src="{value}">',
                                    '</tpl>',
                                    '<span class="temp">{tempMaxF}&deg;<span class="temp_low">{tempMinF}&deg;</span></span>',
                                '</div>',
                            '</tpl>',
                        '</div>'
                    ]);

                    panel.getParent().setMasked({
                        xtype: 'loadmask',
                        message: 'Loading...'
                    });

                    Ext.Ajax.request({
                        url: 'http://localhost:8000/api/myapp/user/',
                        method:'GET',
                        callbackKey: 'callback',
                        defaultHeaders : 'application/json',
                        params: {
                            //key: '23f6a0ab24185952101705',
                            //q: '94301', // Palo Alto
                            format: 'json',
                            //num_of_days: 5
                        },
                        success : function(response, opt) {
                                    dataarray = Ext.decode(response.responseText);
                                    weather=dataarray.objects;
                                    panel.updateHtml(tpl.applyTemplate(weather))
                                    panel.getParent().unmask();
                                    },
                        failure : function(response, opt) {
                                     Ext.Msg.alert('Failed', response.responseText);
                                     panel.getParent().unmask();
                                    }       


                    });
                }
            },
            {
                 text:'login',
                 handler: function() {
                     var main = new Ext.Panel({  
                                   title: 'My first panel', //panel's title  
                                   fullscreen: true,
                                   //the element where the panel is going to be inserted 
                                   //html: 'Nothing important just dummy text' //panel's content  
                                   items:[
                        {
                            xtype: 'fieldset',
                            title: 'Login',
                            items: [
                                {
                                    xtype: 'textfield',
                                    label: 'Username',
                                    name:   'username',
                                    id  :  'username'
                                },
                                {
                                    xtype: 'passwordfield',
                                    label: 'Password',
                                    name:  'password',
                                    id   :  'password'
                                }
                            ]
                        },
                        {
                            xtype: 'button',
                            text: 'Send',
                            ui: 'confirm',

                            handler: function() {}

                        }
                    ]
                                   });  
                 panel.add(main);
                 alert('test');
                 }
            }
            ]
        }]
    }
});

Now when i click on the tab , previous panel will not be cleared and data will get overlapped there ….. like when i click My profile profile is listed there , after that when i click login profile+ login both will be loaded one overlapping another …

  • 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-04T16:51:52+00:00Added an answer on June 4, 2026 at 4:51 pm

    You should use Ext.tab.Panel for this, define your profile and login panels as items of a parent TabPanel, the switching will be handled by ExtJS. You can use the activate event of a Panel to add custom logic to execute when your tabs get activated.

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

Sidebar

Related Questions

I have several tabs in my application, and each tab loads a different sub-page
I have a python program that opens several urls in seperate tabs in a
I have a TabActivity with several tabs. Each tab corresponds to a specific view,
I have several tabs. Each tab has several nested elements that contain checkbox input
I have a tabactivity with several tabs. Each tab has an ActivityGroup associated with
I have a TabControl that contains several tabs. Each tab has one UserControl on
I have several tabs that are loaded via ajax, and each one has a
Depending on my task in Vim I have several tabs open. How can I
I have a Tabactivity with several Tabs and the text is overlaying the images
I have an app with several different tabs. The first of these tabs should

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.