Ext.TabPanel html help
add({
title: args.node.id,
iconCls: 'tabs',
items: [{html: '<code class="prettyprint"><?php\necho \'Hello World!\';</code>', width: '100%', hieght: '100%', plain: true}],
closable: true
}).show();
I am running the above method on Ext.TabPanel and it is returning '' as the html...
If I do
<code class="prettyprint"><html><head><title>Whatever</title></head><body.The body!</body></html></code>
It just renders The body!
... how can I get it to displ开发者_如何学JAVAay the source code??
Many thanks...
You need to transform all the <
and >
into <
and >
.
A better approach would be to include the markup in the HTML of your page, wrapped in a div with an id, then pull that into your Panel via the contentEl
config using that id. Any sort of nontrivial HTML content will very quickly devolve into a world of pain if you try to use the html config for this. HTML-encoding, line breaks, indenting, etc. -- just format the HTML as it's intended to be done -- in HTML.
精彩评论