- Instantiate a hidden iframe
- Dynamically copy the CSS of your app into the iFrame
- Dynamically copy the contents of the panel into the iFrame
- Call the window.print() method on the iFrame
- Destroy the iFrame
Wednesday, February 26, 2014
Ext JS 4: Printing the contents of an Ext.Panel
If you’re creating a line-of-business application, chances are pretty good that your users will need to print some data generated by your application.
As illustrated by the following code snippet, printing the contents of an Ext 4 panel is relatively straightforward. The basic algorithm is as follows:
Once you’ve loaded the override, you can simply call the panel.print() method.
Written by: Steve Drucker
[Cross-promoted on: Druck-I.T.]