Well to start with, putting an iframe in a MODx.Window turns out to be really easy.
You can template it as simply as this:
Doodles.window.IframeWindow = function(config) {
config = config || {};
Ext.applyIf(config,{
title: 'iframe Window'
,width:600
,height:700
,html: '<iframe src="http://www.hkwebdeveloper.com" style="width:98%; height:98%;"></iframe>'
,buttons:[{
text: 'Close'
,scope:this
,handler: function() { this.hide(); }
}]
});
Doodles.window.IframeWindow.superclass.constructor.call(this,config);
};
Ext.extend(Doodles.window.IframeWindow,MODx.Window);
Ext.reg('doodles-window-doodle-iframe',Doodles.window.IframeWindow);
You're just using the html parameter. You can just call it the same way you'd call the other windows in the tutorial.
I'm just guessing but perhaps you could have your callback trigger an event and then put a listener on your window to close.
Is this the kind of thing you're after?
Edit: I overrode the buttons so you've just got a close button.
Rather than hard-code the iframe src like above you could pass a value from the grid:
},showIframeWindow: function(btn,e) {
if (!this.iframeWindow) {
this.iframeWindow = MODx.load({
xtype: 'doodles-window-doodle-iframe'
,iframesrc: 'http://you-could-pull-this-string-from-the-grid.com'
});
}
this.iframeWindow.show(e.target);
}
and then alter the html parameter in the template slightly to include the config value:
,html: '<iframe src="'+ config.iframesrc +'" style="width:98%; height:98%;"></iframe>'
[ed. note: muzzstick last edited this post 11 years, 2 months ago.]