I have a RowExpander defined like this :
var expander = new Ext.ux.grid.RowExpander({
id: 'expander',
tpl : new Ext.Template(
'<pre style="word-wrap:break-word;"><p>{bigText}</p></pre>'
)
});
bigText is returned from server and contains a full html document with all the html tags. For some reason tpl cannot interpret these tags proeprly and the final formatting on the page is messed up(too much spacing between pharagraphs for example).
What is a good way to go about solving this?
EDIT: This is the content returned from server: (Please pardon the poor formatting…)
“bigText”:”\n\n\n \n\n.header {\n\tcolor: black;\n\tfont-family: Arial, Helvetica, Sans-Serif;\n\tfont-size: 10pt\n }\n\n.footer {\n\tcolor:black;\n\tfont-family: Arial, Helvetica, Sans-Serif;\n\tfont-size: 10pt;\n\tfont-style: italic;\n }\n \n .body-header {\n\tcolor: black;\n\tfont-family: Arial, Helvetica, Sans-Serif;\n\tfont-size: 10pt;\n\tfont-weight: bold;\n }\n .body-content {\n\tcolor: black;\n\tfont-family: Arial, Helvetica, Sans-Serif;\n\tfont-size: 10pt;\t\n }\n</style>\n\n</head>\n\n\n\nThis is to notify you that you have an account balance that is greater than or below the threshold viewable on Online Banking for Business. The requested details appear below.
\n\n</p>\n \n\n Account Number: </span> xxxxxxx </span>
\n\n Balance Amount: </span> 100 </span>
\n\n\n
\n\n\n\nThis e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please report to xxx@xx.com or call 1-xxx-xxx-xxxx, and please delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal.
\n\n</p>\n \n\n\nAlert initiated: 06-Sep-2011 at 2:10PM Canada Eastern Time
\n</p>\n \n\n</body>\n</HTML>\n”
If bigText really contains the full HTML document with
<html>,<head>,<title>etc then you better extract only the body part from it.Additionally it doesn’t make sense to wrap it all inside a
<pre>tag. Why are you doing that?If you really want to preserve all the formatting of the HTML page as is, maybe you should use an
<iframe>instead.