PDA

View Full Version : CGI => window



GBenji
11 Jan 2012, 6:15 AM
Hi,

I wanna put a cgi page in a flying window on my website.

I wanted to use an Iframe but it doesn't exist in ExtJs 4, whatever I decided to use an Ext.window.Window like that :



Ext.define('X.X.X.X',{
extend: 'Ext.panel.Panel',
frame:true,
alias: 'widget.X',
loadMask:true,
height: 600,

initComponent: function() {
Ext.Ajax.request({
url: X_URI, // the path of my cgi
success: function(response, requester){
win = new Ext.Window({
id: 'XWindow',
layout:'fit',
width:800,
height:300,
closeAction:'hide',
plain: true,
html: response.responseText
});
},
failure: function(){console.log('erreur')}
});
this.callParent(arguments);
}
});


My problem is : In this second window when I click on a link that change my main window :((

How can I do that when I click on a second window link, it changes the second window but not the main window ?

Thanks

tobiu
11 Jan 2012, 7:42 AM
doug has created a beautiful extension for it:
http://www.sencha.com/forum/showthread.php?137233-Ext.ux.ManagedIframe-4.0-alpha2-for-Ext-4.x

but even without it, it is super simple to add an iframe to a container or creating a custom component for it.

GBenji
11 Jan 2012, 8:54 AM
Thanks a lot

"super simple" for you =;

tobiu
11 Jan 2012, 9:03 AM
for you as well, seriously :)

take a look at:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.AbstractComponent-cfg-autoEl



{
xtype: 'component',
autoEl: {
tag: 'img',
src: 'http://www.example.com/example.jpg'
}
}


just replace the img with an iframe and add all kind of attributes you like to.

dougs ux offers a lot more functionality on top of course.