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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:52:04+00:00 2026-05-18T08:52:04+00:00

I have a Kohana framework which is building ExtJS objects in one view, which

  • 0

I have a Kohana framework which is building ExtJS objects in one view, which in turn loads (via JQuery AJAX) other views inside of it with a this function:

function replaceContentOnClick(id, route) {
    $('body').delegate(('#' + id), 'click', function(){
        $.get(route, function(data) {
            $('#region_center .x-panel-body').html(data);
        });
    });
}

This is working fine but only when these child views are merely HTML/Javascript/JQuery, but in the child views I cannot get any ExtJS objects to display, even if I render them to DOM elements that exist and to which I can successfully append JQuery elements. It is as if the DOM doesn’t exist for ExtJS at that moment.

The main problem is: the JQuery code successfully fills the element:

<script type="text/javascript">
$('#region_center .x-panel-body').html('this is from jquery...');
</script>

but the ExtJS code fails to fill the same element (an there is no error reported in Firebug/Net panel):

<script type="text/javascript">
    var region_center = new Ext.Panel({
        id: 'region_center',
        region: 'center',
        renderTo: '#region_center .x-panel-body',
        margins:'10 10 10 10',
        padding:'10 10 10 10',
        autoScroll:true,
        html: 'this is from ExtJS...'
    });
</script>

What do I have to do so that ExtJS can access the DOM element as JQuery can?

  • 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-18T08:52:05+00:00Added an answer on May 18, 2026 at 8:52 am

    These two bits of code are doing different things. This code:

    <script type="text/javascript">
    $('#region_center .x-panel-body').html('this is from jquery...');
    </script>
    

    …is accessing the DOM node at ‘#region_center .x-panel-body’ and injecting a new innerHTML value. This code:

    <script type="text/javascript">
        var region_center = new Ext.Panel({
            id: 'region_center',
            region: 'center',
            renderTo: '#region_center .x-panel-body',
            margins:'10 10 10 10',
            padding:'10 10 10 10',
            autoScroll:true,
            html: 'this is from ExtJS...'
        });
    </script>
    

    …is attempting to render a complete Panel component into itself (i.e., the renderTo config is pointing at the panel with id ‘region_center’, which is the panel itself). This makes no sense and will not work. You can only render components to an existing DOM node — in this example, there is no existing DOM node with id ‘region_center’ because the panel is not yet (and cannot be) rendered.

    The equivalent code to do exactly what you’re doing in jQuery would be this:

    <script type="text/javascript">
    Ext.get('#region_center').child('.x-panel-body').update('this is from Ext...');
    </script>
    

    Assuming all things are equal in the DOM when this is run, it should execute exactly like your jQuery code.

    Now, assuming that your BorderLayout is properly rendered, and it in fact has a center region with id ‘region_center’, you should be able to add a new panel into it dynamically (make sure the new panel’s id is unique). Note that it would be preferable to go through the Component API (instead of the DOM API) to do this as layout will be managed for you in that case. E.g., you’d want to do something like:

    // assuming myCenterPanel is a valid *component* ref (NOT a DOM element):
    myCenterPanel.add(new Ext.Panel(...));
    myCenterPanel.doLayout();
    

    You’d also want to ensure that the center panel has an appropriate layout assigned (via the layout config). If you simply render the new panel directly to the underlying DOM node instead (as you’re trying to do above), it may work, but in the long term will probably cause you other issues (again, since you are bypassing Ext’s layout manager in that case).

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

Sidebar

Related Questions

In Kohana/CodeIgniter, I can have a URL in this form: http://www.name.tld/controller_name/method_name/parameter_1/parameter_2/parameter_3 ... And then
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
Have you determined a maximum number of characters allowed in FCKEditor ? I seem
Have a n-tire web application and search often times out after 30 secs. How
Have you managed to get Aptana Studio debugging to work? I tried following this,
Have had to write my first proper multithreaded coded recently, and realised just how

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.