2011-05-27 157 views
1

當我產生EXT.Button,還有生成的HTML看起來像這樣:覆蓋EXTJS按鈕HTML

<table id="ext-comp-1015" cellspacing="0" class="x-btn x-btn-text-icon right-toolbar-top-link x-btn-icon"> 
<tbody class="x-btn-small x-btn-icon-small-left"> 
<tr> 
<td class="x-btn-tl"><i>&nbsp;</i></td> 
<td class="x-btn-tc"></td> 
<td class="x-btn-tr"><i>&nbsp;</i></td> 
</tr> 
<tr> 
<td class="x-btn-ml"><i>&nbsp;</i></td> 
<td class="x-btn-mc"> 
<em class="" unselectable="on"> 
<button type="button" id="ext-gen93" class=" x-btn-text">&nbsp;</button> 
</em> 
</td> 
<td class="x-btn-mr"><i>&nbsp;</i></td> 
</tr> 
<tr> 
<td class="x-btn-bl"><i>&nbsp;</i></td> 
<td class="x-btn-bc"></td> 
<td class="x-btn-br"><i>&nbsp;</i></td> 
</tr> 
</tbody> 
</table> 

如何創建並傳遞一個模板到按鈕把它輸出一個簡單的「按鈕」標籤?我使用EXT.js 3.2.1

感謝, 傑米

+0

爲什麼你要? – Gerrat 2011-05-27 20:48:23

回答

0

您可以通過使用Ext.Panel避開它..

new Ext.Panel({ 
    renderTo: 'id-of-element', 
    html: '<button onclick="alert(\'I was clicked\');">Click Me</button>', 
    border: false 
});