View Full Version : Setting button width doesn't seem to work

15 Oct 2009, 2:11 AM
I have this form set up with two buttons:

showFavouritesButton = new Ext.Button({
text : 'Show favourites',
disabled : true,
width : 300,
qtip : 'Click to show only your favourites on the map',
handler : function() { showFavourites();}

hideRejectsButton = new Ext.Button({
text : 'Hide rejects',
width : 300,
disabled : true,
qtip : 'Click to hide all the properties you have marked as rejects.',
handler : function(){hideRejects();}

var hideButtonsForm = new Ext.FormPanel({
id : 'hideButtonsForm',
frame : false,
title : '',
width : '100%',
defaultType : 'textfield',
border : false,
buttons : [showFavouritesButton, hideRejectsButton]

But the buttons don't have a set width - they only have the width of the text. Also, if I add autoWidth: false I get an error: this.autoWidth is not a function

15 Oct 2009, 2:34 AM
Which Ext version are you using? This was fixed some time ago...

For older Ext versions you could use:

autoWidth: Ext.emptyFn

15 Oct 2009, 2:38 AM
For this implementation I'm having to use v2 as the wizard extensions haven't yet been updated fully to cope with v3.

No matter really if it's not possible - it's purely an aesthetic thing which I can deal with.