crouchg
10 May 2007, 9:32 PM
I have an Iframe in the body of a dialog....
if(!printdialog)
{
var y = Ext.DomHelper.append(document.body, {id:'printBox', tag: 'div'}, true);
printdialog = new Ext.BasicDialog(y, {
width: 800,
height: 600,
shadow: true,
modal : false,
resizable : false,
closable : true,
collapsible : false
});
printdialog.addKeyListener(27, printdialog.hide, printdialog);
printdialog.addButton('Print', printThisContent, thisCopy);
printdialog.addButton('Close', printdialog.hide, printdialog);
}
printdialog.setTitle('Print Results');
printdialog.body.dom.innerHTML = '<iframe name=printIframe id=printIframe frameborder=0 style=width:100%;height:100%></iframe>';
printdialog.show(item.dom);
I then try to print the Iframe content after adding some coentent....
function printContent()
{
printIframe.document.write('<html>' + document.getElementsByTagName('head')[0].outerHTML + '<body id=printBody onload="window.print();">'+ document.getElementById('cgtDetailTable').outerHTML +'</body></html>');
}
function printThisContent()
{
printIframe.print();
}
Something seems to be getting in the way? Is the Dialog box keeping the Print Dialog from getting focus.
Any help Please?
if(!printdialog)
{
var y = Ext.DomHelper.append(document.body, {id:'printBox', tag: 'div'}, true);
printdialog = new Ext.BasicDialog(y, {
width: 800,
height: 600,
shadow: true,
modal : false,
resizable : false,
closable : true,
collapsible : false
});
printdialog.addKeyListener(27, printdialog.hide, printdialog);
printdialog.addButton('Print', printThisContent, thisCopy);
printdialog.addButton('Close', printdialog.hide, printdialog);
}
printdialog.setTitle('Print Results');
printdialog.body.dom.innerHTML = '<iframe name=printIframe id=printIframe frameborder=0 style=width:100%;height:100%></iframe>';
printdialog.show(item.dom);
I then try to print the Iframe content after adding some coentent....
function printContent()
{
printIframe.document.write('<html>' + document.getElementsByTagName('head')[0].outerHTML + '<body id=printBody onload="window.print();">'+ document.getElementById('cgtDetailTable').outerHTML +'</body></html>');
}
function printThisContent()
{
printIframe.print();
}
Something seems to be getting in the way? Is the Dialog box keeping the Print Dialog from getting focus.
Any help Please?