English 中文(简体)
为什么该批货物法的回归无效,批号4.0.7?
原标题:why this extjs code return null with extjs 4.0.7?

我使用了该守则,该守则在论坛上发现,4.0.2a没有错误,现在4.0.7给我错误f 无效。 i 携带火力检查,发现

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

c) 婴儿(一机)返回无效。

为什么这种情况发生于4.07?

http://jsfiddle.net/Cu9DZ/"rel=“nofollow> 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");
                    }
                }
            }]          
});
最佳回答

我在这里发现几处ug。

  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 )

http://jsfiddle.net/Cu9DZ/3/“rel=“nofollow” http://jsfiddle.net/Cu9DZ/3/。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签