PDA

View Full Version : print Ext.Window



EducatedFool
7 Aug 2009, 1:59 AM
Hello guys,

I'm converting an old site to Zend/Extjs. In the old site, we have a javascript window popup that's openend, filled up with data, then printed and closed. Something like this:




var printWin = window.open('','','width=221,height=115,scrollbars=no,toolbar=no,location=no,status=no,menubar=yes,directories=no,resizable=no');
printWin.document.open();
printWin.document.write("bla bla bla");
printWin.document.close();
printWin.print();
printWin.window.close();


Now, converting it to Extjs I made something like this:




win =

new Ext.Window({

title : 'Print',
width : 850,
height : 280,
layout : 'fit',
items: {
xtype : 'iframepanel',
defaultSrc : 'http://...'
},
shim : false,
frame : true,
animCollapse : false
});
win.show();


Is there a way to print the content in this window? Or how could I handle the window.open() and window.print() with Extjs?

thanks!

hendricd
7 Aug 2009, 1:30 PM
Hello guys,

I'm converting an old site to Zend/Extjs. In the old site, we have a javascript window popup that's openend, filled up with data, then printed and closed. Something like this:




var printWin = window.open('','','width=221,height=115,scrollbars=no,toolbar=no,location=no,status=no,menubar=yes,directories=no,resizable=no');
printWin.document.open();
printWin.document.write("bla bla bla");
printWin.document.close();
printWin.print();
printWin.window.close();
Now, converting it to Extjs I made something like this:




win =

new Ext.Window({

title : 'Print',
width : 850,
height : 280,
layout : 'fit',
items: {
xtype : 'iframepanel',
defaultSrc : 'http://...'
},
shim : false,
frame : true,
animCollapse : false});
win.show();




Is there a way to print the content in this window? Or how could I handle the window.open() and window.print() with Extjs?

thanks!



For that config, it should be (after all is rendered of course):




win.items.first().getFrame().print();

lordmax
9 Dec 2009, 6:03 PM
HI.
I have the same problem but EXT return an error "getFrame is'n a function"

Anyone can help?
Please