Ph: 04082008


Reply
  #1  
Old 04-04-2008, 05:42 PM
Steffen Hiller's Avatar
Ext JS Premium Member
 
Join Date: Mar 2008
Posts: 69
Steffen Hiller is on a distinguished road
ArrowExt.ux.PrinterFriendly, 0.2

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
Attached Files
Reply With Quote
  #2  
Old 04-04-2008, 09:56 PM
Ext Premium Member
 
Join Date: Apr 2007
Posts: 64
Hani is on a distinguished road
Default

Looks very useful, but doesnt work on safari
Reply With Quote
  #3  
Old 04-04-2008, 10:36 PM
Steffen Hiller's Avatar
Ext JS Premium Member
 
Join Date: Mar 2008
Posts: 69
Steffen Hiller is on a distinguished road
Default

Quote:
Originally Posted by Hani View Post
Looks very useful, but doesnt work on safari
Hey hani, my bad, I didn't test it on safari nor internet explorer. Only Firefox 2. I just tested it on my Safari 2 (Mac) and the PrinterGridPanel did not show up. I guess that's what you mean with "not working", right? Well, thanks for the hint, I'll check that this weekend!

Regards,
Steffen
Reply With Quote
  #4  
Old 04-05-2008, 12:24 AM
Ext Premium Member
 
Join Date: Sep 2007
Posts: 142
jerrybrown5 is on a distinguished road
Default

This is a nice idea. Pure HTML rendering is also helpful in SEO caching strategies, which of course is a gaping hole in fully rendered Ext pages. As of right now you need to manually create redundant stupid/simple landing pages for everything that you want cached by the search engines. Saying goodbye to this equals a good thing.

Best regards,
Jerry Brown
Reply With Quote
  #5  
Old 04-05-2008, 02:11 AM
Steffen Hiller's Avatar
Ext JS Premium Member
 
Join Date: Mar 2008
Posts: 69
Steffen Hiller is on a distinguished road
Default

Quote:
Originally Posted by jerrybrown5 View Post
Pure HTML rendering is also helpful in SEO caching strategies
Hey Jerry,

even though SEO would be a good side effect of this extension, I don't think that this extension is actually more SE-friendly. The difference between my PrinterGridPanel class and the official GridPanel class is "only" that the rendering process is less cpu and memory intensive and that the generated html is smaller than with the normal GridPanel.
BUT, the table/grid is still generated by javascript, and that's still the same problem for search engines, as with the normal GridPanel.
So if you want to do SE-optimized landing pages, I think you still would have to do extra server-side coding.
Sorry on disappointing you on that part, or do I look at this the wrong way?

Regards,
Steffen
Reply With Quote
  #6  
Old 04-05-2008, 02:57 AM
Ext Premium Member
 
Join Date: Sep 2007
Posts: 142
jerrybrown5 is on a distinguished road
Default

Steffen,
You are right in that it would have to tie into a server based solution for which simple html (from javascript creation) is only a part of it. What is needed is a simple server based Ext aware IEBrowser (shdocvw.dll or similar) web bot component to go through a site with a certain querystring to clear the javascript and extract simple and very cacheable html. Alternatively, you could do the same with firefox on a string (XPCOM?). Once you can generate the simple html on command the rest is easy.

The thee current and not very good choices:
* Simple Web 1.0 site which is SEO cacheable and steadily lose customers to Web 2.0 sites (not an option)
* Fully JS rendered Web 2.0 site which is not SEO cacheable and wait on laurels for the SEs to improve (not an option)
* Double programming (not an option)

Best regards,
Jerry
Reply With Quote
  #7  
Old 04-05-2008, 06:43 AM
Ext User
 
Join Date: Jan 2008
Posts: 7
tyr is infamous around these parts
Default

... a very interesting extension.
'PrinterView's are a very usefull feature. I look forward to see more about this ;-)
Reply With Quote
  #8  
Old 04-05-2008, 01:42 PM
Steffen Hiller's Avatar
Ext JS Premium Member
 
Join Date: Mar 2008
Posts: 69
Steffen Hiller is on a distinguished road
Default

Hey Jerry,

ok, I got it. Combined with your mentioned technologies, this extension really could offer SEOs another option. A good side effect then. :-)

Regards,
Steffen
Reply With Quote
  #9  
Old 04-08-2008, 06:06 AM
Ext User
 
Join Date: Jan 2008
Posts: 99
vizcano is infamous around these parts
Default

I'm trying the example provided, and I've seen that if you increase the items of the array it does not print more than one page, is there a way to print more than one page? I've got a huge grid and i'd like to be able to print it, I need at least 3pages to print it

Thanks
Reply With Quote
  #10  
Old 04-08-2008, 08:16 AM
Steffen Hiller's Avatar
Ext JS Premium Member
 
Join Date: Mar 2008
Posts: 69
Steffen Hiller is on a distinguished road
Default

Quote:
Originally Posted by vizcano View Post
I'm trying the example provided, and I've seen that if you increase the items of the array it does not print more than one page, is there a way to print more than one page? I've got a huge grid and i'd like to be able to print it, I need at least 3pages to print it

Thanks
Hey vizcano,

did you set the Ext.PRINTER_FRIENDLY_CSS_URL constant in your ux.PrinterFriendly/init.js file? That css is important for exactly your problem.

Regards,
Steffen
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 09:57 PM.

© 2006-2008 Ext, LLC
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

Ext JS

Cross-browser JavaScript library for building rich internet applications


Ext GWT

Java library for building rich internet applications with GWT

Support Subscriptions

With 1-on-1 email and phone support, we solve your Ext JS, GWT, CSS and JavaScript issues


Training

Get up to speed quickly with on-site training provided by Ext


Community

The Ext community forums and wiki


Ext Solutions

Enterprise consulting and custom development

Ext JS


Ext GWT


Help


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser