PDA

View Full Version : need help in printing a pop up window



rex0098
1 Dec 2009, 12:39 AM
hello everyone i need to know how to print the content of a pop up window in ext that contains the data that i typed in my form. first off i made a form where i can input my data then then after that if i click the submit button a pop up window will appear with my data and a print button in the bottom.

this is my code for the save button on my form. if i click the "yes" in the message box the window will appear with my data on it then i can print it. My problem is that it prints the whole content of the browser not the content of the window i created. please help me. i know this one is easy for you guys and im just beginning ti explore ext. thanks...

//print_content is the window that will hold the data i want to be printed..but left it balnk here...:)



var form_buttons_save = {
text: 'Save',
//formBind:true,
handler: function () {
var myCallback = function(btn) {
//console.info('You pressed ' + btn);
if (btn == 'yes') {
var print_content= new Ext.Window({
width:865,
id:'pawn_print',
height:620,
modal:true,
buttonAlign:'center',
buttons:
[{
text:'print',
handler:function(){window.print(print_content);}
}]
});
print_frm.show();

}
}
var msg = 'Are you sure.';
var title = 'Pawn Item'
Ext.MessageBox.confirm(title, msg, myCallback);
}
}

lordmax
9 Dec 2009, 5:47 PM
My problem too.
It seems that window.print do a printscreen

Anyone can help?