Ext.ux.grid.Printer is a small library that provides a way of printing Ext Grid Component.
Place the folder ux/grid in your project.
In your application file, please add:
Ext.Loader.setConfig({enabled: true});
Ext.require([ 'Ext.ux.grid.Printer', ]);
Ext.ux.grid.Printer.print just take a single argument - a normal grid instance. Use it like this:
var myGrid = new Ext.grid.GridPanel({ //your usual grid config here });
Ext.ux.grid.Printer.print(myGrid);
Open example.html to see how to use it.
You can customize some options:
- Ext.ux.grid.Printer.printAutomatically = false; – to disable the automatic printing (the print window will not open, user will only see the print version of the grid).
- Ext.ux.grid.Printer.stylesheetPath = ‘/some/other/path/gridPrint.css’; – to change the path of the css file.
You need to set the custom config before calling Ext.ux.grid.Printer.print function.
Demo: http://loianegroner.com/extjs/examples/extjs4-ux-gridprinter/
Plugin originally developed by Ed Spencer (Ext JS 3.x)
Plugin ported to Ext JS 4 by Loiane Groner
- http://loianegroner.com (English)
- http://loiane.com (Portuguese)