Skip to content
Browse files

Added stylesheet, updated README

  • Loading branch information...
1 parent 7caf57b commit db9204eaf9b616a1a181a36c58c6be2cf839fa2e Ed Spencer committed Jul 28, 2009
Showing with 54 additions and 4 deletions.
  1. +31 −4 README
  2. +23 −0 print.css
@@ -1,11 +1,38 @@
Ext.ux.Printer is a small library that provides a generic way of printing Ext Components (Grids, Trees, etc).
+It consists of the main Printer class, and a number of Renderers, which each provide support for a given type of component.
+Printer.js and renderers/Base.js are required:
+<script type="text/javascript" src="Printer.js"></script>
+<script type="text/javascript" src="renderers/Base.js"></script>
+The library currently comes with renderers for Ext.grid.GridPanel, and Ext.tree.ColumnTree. These can be included as required:
+<script type="text/javascript" src="renderers/GridPanel.js"></script>
+<script type="text/javascript" src="renderers/ColumnTree.js"></script>
+Ext.ux.Printer.print just take a single argument - a normal component instance. Use it like this:
+var myGrid = new Ext.grid.GridPanel({
+ //your usual grid config here
-Use it like this:
+var myTree = new Ext.tree.ColumnTree({
+ //your usual tree config here
-Each of the above examines the component you pass to the print function, and if a suitable printer has been created
+Each of the above examines the component you pass to the print function, and if a suitable renderer has been created
for it, the component is printed by opening a new window, writing some print-friendly HTML to it, and calling the
window's print function.
23 print.css
@@ -0,0 +1,23 @@
+html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}img,body,html{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;}q:before,q:after{content:'';}
+table {
+ width: 100%;
+ text-align: left;
+ font-size: 11px;
+ font-family: arial;
+ border-collapse: collapse;
+table th {
+ padding: 4px 3px 4px 5px;
+ border: 1px solid #d0d0d0;
+ border-left-color: #eee;
+ background-color: #ededed;
+table td {
+ padding: 4px 3px 4px 5px;
+ border-style: none solid solid;
+ border-width: 1px;
+ border-color: #ededed;

0 comments on commit db9204e

Please sign in to comment.
Something went wrong with that request. Please try again.