PDA

View Full Version : Print an ExtJS component



same66
10 Mar 2011, 5:09 AM
Hi,

I'm trying to print an ExtJS Component but I can't find what I want.
I want just print a DIV and not the html page but... how to do that ?

ExtJS Printer plugin exist ?
Another method ?

Any help is appreciated

mankz
10 Mar 2011, 5:15 AM
Google is your friend http://www.google.se/search?q=ext+ux+printer

:)

same66
10 Mar 2011, 6:44 AM
Thanks :)
I'm trying Ext.ux.Printer for a panel print but when the print is generated the print is empty.


/**
* Prints the contents of an Ext.Panel
*/
Ext.ux.Printer.PanelRenderer = Ext.extend(Ext.ux.Printer.BaseRenderer, {
/**
* Generates the HTML fragment that will be rendered inside the <html> element of the printing window
*/
generateBody: function(panel) {
return String.format("<div class='x-panel-print'>{0}</div>", panel.body.dom.innerHTML);
}
});

Ext.ux.Printer.registerRenderer('panel', Ext.ux.Printer.PanelRenderer);

Ext.ux.Printer.print(this.ctrlPanel);

and I add two link in the head html (Printer.js and Base.js).

Do you have an idea ?

Thanks

steffenk
10 Mar 2011, 9:00 AM
I simply fetch the dom of a component and write it in a new browser window for print - there you need no ExtJS at all, only the CSS involved.