Thanx for the answer. It helped.
Default template for the button is a table with 3 columns. I modified it and applied width and height attributes to the center TD element and the button resized as expected. However, the background images don't stretch and unwanted parts of the sprite (btn-sprite.gif) show up.
Attachment:
resize_button_template.jpg [ 3.77 KB | Viewed 1693 times ]
I am not comfortable with CSS. Tried tweaking x-btn-left, x-btn-center and x-btn-right CSS classes but in vain. Any idea as to what CSS change is necessary to stretch the background images?
Modified button template with width and height for center TD:
Code:
Template t = new Template("<table cellpadding=\"0\" cellspacing=\"0\" class=\"x-btn-wrap\">" +
"<tbody>" +
"<tr>" +
"<td class=\"x-btn-left\"><i> </i></td>" +
"<td class=\"x-btn-center\" width=\"80px\" height=\"80px\">" +
"<em unselectable=\"on\"><button class=\"x-btn-text\" type=\"{1}\">{0}</button></em></td>" +
"<td class=\"x-btn-right\"><i> </i></td>" +
"</tr>" +
"</tbody>" +
"</table>");
btn.setTemplate(t);