开发者

Ext.TabPanel html help

开发者 https://www.devze.com 2022-12-29 16:21 出处:网络
add({ title: args.node.id, iconCls: \'tabs\', items: [{html: \'<code class=\"prettyprint\"><?php\\necho \\\'Hello World!\\\';</code>\', width: \'100%\', hieght: \'100%\', plain: true}],
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 &lt; and &gt;.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消