PDA

View Full Version : Getting rid of all links in a page



Hani
20 Sep 2007, 5:12 AM
I'd like to present a printable type view of a page (and also allowing said page to be opened in excel), and as part of that, I'd like to basically get rid of all links. Not just blank out the hrefs, but get rid of any link styling to. Anyone have any ideas on how best to do this with ext? One possible approach is, in pseudocode:

get all a elements within the top level div
for each a:
create span
copy a's innerHTML to the span
replace a with span

How would I express that in ext? Can anyone suggest a better solution?

fay
20 Sep 2007, 5:26 AM
Create a seperate style sheet for print media (with the <A> styles as "normal text"):


<link rel="stylesheet" media="print" href="print.css" type="text/css" />

Also take a look at http://extjs.com/deploy/ext/docs/output/Ext.util.CSS.html#swapStyleSheet