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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:12:45+00:00 2026-06-10T08:12:45+00:00

I have an extjs4 panel created using this config object. { title : ‘Messages’,

  • 0

I have an extjs4 panel created using this config object.

{ 
    title : 'Messages',
    region : 'north',
    height : 200,
    minSize : 75,
    maxSize : 250,
    cmargins : '0 0 5 0',
    html : '<i>Chat started on ' +  Ext.Date.format(dt, EI.datePattern)  + '</i>'
}

Now I want to append more html on it. For example I want to append

<p><span class="user">me:</span><span class="how are you?"></span></p>

Sometimes I could append using

 thePanel.body.insertHtml("beforeEnd", chatHtml);

But I see sometimes .body is not set!! So I can not execute the above code. What is the proper way to do it?

  • 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-10T08:12:47+00:00Added an answer on June 10, 2026 at 8:12 am

    The body element of a panel isn’t available until after the panel’s render event has fired. This is the same for all elements that are listed under the childEls config of any component.

    There are a few different ways an element can be rendered. This isn’t a comprehensive list.

    1. If a component is a child item of a container, then the component will be rendered when the parent container renders. The exception to this is containers using card layout, such as a tab panel, when using the deferredRender config.

    2. If a component is not a child of a container, but it is using the renderTo config, it will be rendered upon construction, even if it is hidden.

    3. If a non-floating component is using the autoRender config, that component will render the first time it is shown, such as with panel.show(). If it is using both autoRender and autoShow then it will be rendered upon construction.

    4. Floating components such as windows default to autoShow: false and autoRender: true, so they will not render until you call win.show(). If you set autoShow to true, it will render on creation.

    5. Floating components using the renderTo config will render on creation and stay hidden, unless also using autoShow as mentioned above.

    It sounds like you have a panel that is a child of a window, correct? To get that panel to render immediately but stay hidden, set renderTo: Ext.getBody() on the parent window.

    Alternatively, you can still access the panel.html property before the panel is rendered, and any changes will be reflected when the window is shown. So if you need to access the inner content but you can’t guarantee the panel has been rendered, you might do something like this:

    if (panel.body) {
        panel.body.insertHtml("beforeEnd", chatHtml);
    } else {
        panel.html += chatHtml;
    }
    

    One last thing. If you set the html config of a panel then render it, there will be an extra div called the clearEl after your original content. Calling panel.body.insertHtml() after render will place the new HTML after this div. This may or may not be a problem for you, but I thought I’d mention it anyway.

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

Sidebar

Related Questions

I am using ExtJS 4. I have created a tree panel as var treeStore
I have a ExtJS panel inside a viewport center region. I want to hide
I'm using ExtJS 3.2 and have content inside of a tab panel, and the
I have a extjs panel rendered inside a div like this: panel = new
I would like to have a panel with a google map using google's javascript
I have created Form and Grid Panel in Extjs now i want to display
I have a tree panel in an ExtJS4 application and I want to change
I have created a Layout using ExtJs. It consists of a left menu and
I have a grid panel in ExtJS 4 with the following features: extend :
I have rails 3.1.0 & ruby 1.9.2 playing around with netzke & extjs4. 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.