It also includes the themes that are OOB (Out of the Box) such as Triton, Neptune, Grey, Crisp, and Classic.Ext JS provides the drag and drops functionality for components and UI containers.Ext JS supports the localization of the packages that helps you to localize the application.
EXTJS PRINT WINDOW CONTENTS CODE
Ext JS framework allows us to create an enterprise application with user experience with the help of JavaScript, without writing the code of CSS or HTML 5. It helps you to create data-intensive HTML 5 applications by using JavaScript. There is a default print.css stylesheet included with the extension to get you started, and you can specify where to find this stylesheet like this:Įxt.ux. = '/path/to/print/stylesheet.Ext JS is a powerful application development platform based on JavaScript.
Take a look at the Grid Renderer and the ColumnTree Renderer for examples of rendering more advanced components.Īs usual, all of the Ext.ux.Printer source is available on Github, and the README file there contains instructions for installation and usage.įinally, when the printing window is opened it includes a stylesheet that it expects to find at "/stylesheets/print.css".
You can now print Ext.Panels the same way you'd print a Grid or a Tree. As many Ext components inherit from Ext.Panel this can function as a catch-all renderer. Internally, Ext.ux.Printer examines the xtype chain of the component you pass it to print, and uses the first renderer that matches. Notice that we registered this renderer for all components with the xtype of 'panel'. Whatever this function returns is rendered inside the tag of the newly-opened printing window. We subclassed Ext.ux.Printer.BaseRenderer, and in this case all we needed to do was provide an implementation for generateBody. This is probably the simplest print renderer of all - we're simply grabbing the HTML from inside a the panel's body and returning it inside our own div. Var grid = new (", ) Įxt.ux.Printer.registerRenderer('panel', Ext.ux.Printer.PanelRenderer) Seeing as some of the work was already done for the Grid example, it made sense to create a common API for printing any Ext.Component. After my recent foray into printing grids with ExtJS, I realised I needed to print some trees too.