我使用了该守则,该守则在论坛上发现,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");
}
}
}]
});