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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:22:21+00:00 2026-05-28T04:22:21+00:00

I used this code which found on forum without errors in 4.0.2a and now

  • 0

I used this code which found on forum without errors in 4.0.2a and now 4.0.7 gives me error f is null so i checked with firebug and found out that

getIframe: function() {
  return this.getTargetEl().child('iframe');
},

this.getTargetEl().child(‘iframe’) is return null

so any idea why this happen with 4.0.7?

http://jsfiddle.net/Cu9DZ/

Ext.define('Ext.panel.iframePanel', {
    extend  : 'Ext.panel.Panel',
    alias   : 'widget.iframePanel',

    src             : 'about:blank',
    loadingText     : 'Loading ...',
    loadingConfig   : null,

    renderTpl: [
        '<div class="{baseCls}-body<tpl if="bodyCls"> {bodyCls}</tpl><tpl if="frame"> {baseCls}-body-framed</tpl><tpl if="ui"> {baseCls}-body-{ui}</tpl>"<tpl if="bodyStyle"> style="{bodyStyle}"</tpl>>',
        '<iframe src="{src}" width="100%" height="100%" frameborder="0"></iframe>',
        '</div>'
    ],

    initRenderData: function() {
        return Ext.applyIf(this.callParent(), {
            bodyStyle: this.initBodyStyles(),
            bodyCls: this.initBodyCls(),
            src: this.getSource()
        });
    },

    initComponent: function() {
        this.callParent(arguments);
        this.on('afterrender', this.onAfterRender, this, {});
    },

    /**
     * Gets the iframe element
     */
    getIframe: function() {
        return this.getTargetEl().child('iframe');
    },

    getSource: function() {
        return this.src;
    },

    setSource: function(src, loadingText) {
        this.src = src;
        var f = this.getIframe();
        if (loadingText || this.loadingText) {
            this.body.mask(loadingText || this.loadingText);
        }

        f.dom.src = src;
    },

    resetUrl: function() {
        var f = this.getIframe();
        f.dom.src = this.src;
    },

    onAfterRender: function() {
        var f = this.getIframe();
        f.on('load', this.onIframeLoaded, this, {});
    },

    onIframeLoaded: function() {
        if (this.loadingText) {
            this.body.unmask();
        }
    }
});

var printpanel = Ext.create('Ext.panel.Panel', {
    title       : 'Print',
    width       : 800,
    height      : 300,
    renderTo    : Ext.getBody(),
    bodyPadding : 5,
    layout      : 'fit',
    items:  Ext.widget('iframePanel', {
            border  : false,
            src     : '',
            itemId  : 'ds_print_panel'
            }),
    tbar: ['->',{
                text        : 'Test',           
                listeners: {
                    click: function(){
                        printpanel.down('#ds_print_panel').setSource("http://www.rockstown.com/node/4");
                    }
                }
            }]          
});
  • 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-28T04:22:22+00:00Added an answer on May 28, 2026 at 4:22 am

    I’ve found few bugs here.

    1. As you already know child('iframe') returns null, because in Ext4 it selects a single direct child (in opposite to Ext3). You should use down('iframe') instead
    2. body is undefined in iframePanel, use getTargetEl() instead
    3. printpanel.down('#ds_print_panel') doesn’t work neither, you can use eg. this.findParentByType('panel')

    Here is working sample: http://jsfiddle.net/Cu9DZ/3/

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

Sidebar

Related Questions

This code used to return my local ip address as 192.xxx.x.xxx but now it
I'm working with some Fortran code (which I'd never used until this project...) and
I used this code to print the current page: <form> <input type=button value=Print onClick=window.print();
I have used this code for extracting urls from web page.But in the line
On a Vista dev machine I used this code successfully to change user Administrator
I am creating a rails app and have used this code in one of
I am trying to rotate an image in OpenCV. I've used this code that
This code used to work but doesnt any more. i used a breakpoint, and
...at least to me. This code used to work fine. I'm pretty sure nothing
this code in my plugin used to work just fine: jQuery('#embedded_obj', context).get(0).getVersion(); and the

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.