Hey,
I'm happy to announce the first release of my (first) Ext JS extension.
Here are the facts:
Name
Ext.ux.PrinterFriendly
Summary
Easily build printer friendly layouts and grids for your Ext JS pages.
Features
Builds a normal html table (Ext.ux.PrinterGridPanel) based on your data store and column model, which saves a lot of cpu power and memory when printing large data sets. Moreover it shows all rows. (Remember, you can't use ext's pagination or scrolling on paper. ;-)) Remembers the state of your grid, such as that hidden columns stay hidden in printer friendly view, keep their column order and keep the row sorting. (This is not really a feature of this extension, it just uses the fabulous Ext.state.Manager, but I think it's important to mention, since this was an important requirement for me.) Completely Javascript-driven, no need for extra server-side coding for printer friendly pages Enables easy debugging of your printer-friendly layout (just add ?format=printerfriendly to your page url to see printer friendly view) Enables adding your custom stylesheet for your printer-friendly format
Source
See attachments
Documentation (Actually, where you will find it soon...)
http://extjs.com/learn/Extension:PrinterFriendly
Example
See attachments
Feedback
Any Feedback via comments on this post in this forum or in my
blog is welcome!
I hope you find this extension as useful as I do! :-D
Regards,
Steffen
Update: Version 0.2 (04-08-2008)
Changes
Added config.js file for customized settings Added Ext.ux.PrinterFriendly.ENABLE_SHORTCUTS config option Added Ext.ux.PrinterFriendly.ROOT constant Added x-grid3-cell-first and x-grid3-cell-last class to header cells Added config parameter to printPreview to set config options for the print preview window, i.e. the title Added 'printer-window' id for printer window Added init.js file, which loads dynamically all other required files Added closeText and printText config option to PrinterWindow for localization purposes Added hiding of body until the printing layout gets initiated, this way the user doesn't see the page without the custom printer css, which the user might add in the onPrinting function Removed Ext.PRINTER_FRIENDLY_CSS_URL constant Changed all internal extensions to use Ext.ux.PrinterFriendly namespace Changed name of format parameter from format to _format, since it conflicts with the format parameter in Ruby on Rails Changed loading of printer friendly css file, will be loaded now when loading js scripts, which prevents the user from seeing the page before the css is loaded Fixed error in Safari in addStyleSheet method which caused that onPrinting is not executed Fixed print button for IE, IE is printing the content of the iframe now Fixed css bug in IE, empty cells will be filled with now, so that the css border is shown