PDA

View Full Version : Ext.button.Button template



andy13c72back
4 Mar 2011, 8:16 PM
Hi guys,

I set Ext.button.Button's template as Following code in Extjs 4, but the template seems not work

this.startBtn = new Ext.button.Button({
text: 'start',
id: 'ux-startbutton',
iconCls: 'start',
menu: this.startMenu,
menuAlign: 'bl-tl',
renderTo: 'ux-taskbar-start',
clickEvent: 'mousedown',
template: new Ext.Template(
'<table cellspacing="0" class="x-btn"><tbody class="{1}"><tr>',
'<td class="ux-startbutton-left"><i>&#160;</i></td>',
'<td class="ux-startbutton-center"><em class="{2} unselectable="on">',
'<button class="x-btn-text" type="{0}" style="height:30px;"></button>',
'</em></td>',
'<td class="ux-startbutton-right"><i>&#160;</i></td>',
'</tr></tbody></table>')
});

which produced following html,

<div id="ux-startbutton" class="x-btn x-btn-default x-btn-default-small x-btn-small x-btn-default-small-icon-text-left x-btn-text-icon x-btn-text-icon-left" style="width: auto; ">
<em class="x-btn-arrow x-btn-arrow-right" id="ext-gen1012">
<button type="button" role="button" id="ext-gen1011" class="x-btn-text start" aria-haspopup="true">??
</button>
</em>
</div>

any ideas? thx in advance