Jamie
Jamie

Reputation: 11

Override EXTJS Button HTML

When I generate an EXT.Button, there resulting HTML looks like this:

<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>

How can I create and pass a template into the button to have it output simply a "button" tag? I am using EXT.js 3.2.1

Thanks, Jamie

Upvotes: 1

Views: 2571

Answers (1)

JamesHalsall
JamesHalsall

Reputation: 13505

You can get around it by using an Ext.Panel..

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

Upvotes: 1

Related Questions