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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:21:42+00:00 2026-06-11T18:21:42+00:00

Am having a controller which basically calls a message window that is displayed for

  • 0

Am having a controller which basically calls a message window that is displayed for a few seconds. Am trying to add a button to this message window, but its returning [object][object].

Controller

success : function(response) {

                this.mWin = Ext.create('App.view.GenMessage');
                this.mWin.addMessage(true, LANG.SUCT, LANG.SUCTxt1);
}

View

Ext.define('App.view.GenMessage', {
extend : 'Ext.panel.Panel',
alias : 'widget.genmessage',

initComponent : function() {

    this.msgCt = App.genMsgCt
    this.msgCt.setWidth(300);
},
addMessage : function(status, title, msg) {

    if (status == false) {
        delay = 3000;
    } else {
        delay = 2000;
    }

    Ext.DomHelper.append(this.msgCt, {
        html : this.buildMessageBox(status, title, msg)
    }, true).slideIn('t').pause(delay).ghost("t", {
        remove : false
    });
},

/*
 * buildMessageBox
 */
buildMessageBox : function(status, title, msg) {
    console.log('buildMesssage');

    switch (status) {
        case true :
            var icon = GENHTML.tick;
            break;
        case false :
            var icon = GENHTML.warning;
            break;
    }

    return ['<div class="genMsgDiv">', icon,
                    '<div class="genMsgHd leftMargin">', title,
                    '</div><div class="H3 leftMargin">', msg,
                    '</div></div>'].join('');
}

What i did was declare a button like

var button={
id: 'button1',
text :'Button1'
}

and then add to the div class mentioned above and return

['<div class="genMsgDiv">', button].join();

But, what i see in the screen is [object][object] in place of the button.
Could anyone please tell me what am doing wrong here. Is this the correct way to add the button

EDIT

Since we cannot add a button to a div, i tried doing

var config = Ext.create(Ext.panel.Panel, {



                itemId : 'GENMSGPANEL',

                height : 150,
                cls : 'msg effect1',

                border : false,
                html : '<div class="genMsgDiv">' + icon +
                    '<div class="genMsgHd leftMargin">'+ title +
                    '</div><div class="H3 leftMargin">'+ msg +
                    '</div></div>',


                items : [{
                    xtype : 'panel',
                    //cls : 'winTitle',

                }, {
                    xtype : 'form',
                    itemId : 'GENMSGFORM',
                    border : false,
                    title : '',
                    buttonAlign : 'center',
                    fieldDefaults : {
                        msgTarget : 'side',
                        labelWidth : 110,
                        size : 30
                    },
                    buttons : [{
                        text : LANG.BTYES,
                        iconCls : 'icon-tick-tb',
                        iconAlign : 'right',
                        cls : 'tip-btn',
                        action : 'genDelete',
                        id : 'BTYES'
                    }, {
                        text : LANG.BTNO,
                        iconCls : 'icon-cross-tb',
                        iconAlign : 'right',
                        cls : 'tip-btn',
                        action : 'notDelete',
                        id : 'BTNO'
                    }]
                }]
            });


    return config;

But, even this did not return anything

  • 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-11T18:21:44+00:00Added an answer on June 11, 2026 at 6:21 pm

    The answer is simple: You cannot add a ExtJS Button into the html config property of a component. This one is just for plain html. ExtJS objects belongs into the items array.

    Decide to place your html content into a box (xtype for component) and add this to the items array. Then you can add your button. Don’t use the html at all in your case.

    You may change/set any required classes. Please note that I haven’t check the way you manipulate the DOM.

    // you may use a layout to align them
    items : [
        { 
            xtype: 'box',
            cls : 'msg effect1',
            html : '<div class="genMsgDiv">' + icon +
                '<div class="genMsgHd leftMargin">'+ title +
                '</div><div class="H3 leftMargin">'+ msg +
                '</div></div>'
        },
        {
            xtype : 'panel',
            //cls : 'winTitle',
        },
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are having this problem with a controller right now; the controller looks like
CakePHP Newbie :) I am having trouble accessing another controller and passing that data
I am having this rather long json output in my controller, I wish to
Basically, I started working on this app knowing nothing about web development which is
I'm having a tough time deciding how to refactor this method in my controller.
I'm having trouble using a tab navigation application. Basically I start on this screen
I am new to Zend framework. I am having a controller interact with a
Having problems with the combining of two statements in a controller. Both statements work
I'm having trouble navigating to a different controller view from another controller action. e.g.
I am having troubles passing data from the controller to the model in opencart(1.5.3).

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.