PDA

View Full Version : [FIXED] button disable/enable



dddesign
12 Sep 2010, 11:37 PM
I know there is a config option to disable a button (disabled: true). but is there also a method to enable it again (or better to toggle it)?
thanks j

evant
12 Sep 2010, 11:40 PM
enable()/disable()/setDisabled()

dddesign
12 Sep 2010, 11:58 PM
thanks, I'll give a try. but, can't find this in the api docs. are these missing or where do I have to search?

evant
13 Sep 2010, 12:08 AM
There's an issue with the doc builder, it'll be fixed in the next release.

dddesign
13 Sep 2010, 5:25 AM
I set some buttons of a splitbutton to disable(), they grayed out and there's no click event. this is as aspected. but the button itself get highlighted. how can I prevent this highlight?

dddesign
21 Sep 2010, 1:51 PM
I upgraded to 0.95 but this is still the same: disabled but will get highlighted when clicked.... any tips?

aconran
23 Sep 2010, 4:06 PM
Sounds like a bug to me. Just to clarify, you are creating a SplitButton, you disable the SplitButton but then the sub buttons still provide highlighting when you tap them?

aconran
23 Sep 2010, 4:30 PM
Used the following code to test both the current repo and the 0.95 release.

I did not encounter the issue you described.



Ext.setup({
onReady: function() {
var tapMe = function(){};
var splitBtn = new Ext.SplitButton({
id: 'split',
allowMultiple: true,
disabled: true,
items: [{
text: 'Option 1',
active: true,
handler: tapMe
},{
text: 'Option 2',
active: true,
handler: tapMe
},{
text: 'Option 3',
handler: tapMe
}]
});
new Ext.Panel({
fullscreen: true,
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [splitBtn]
}]
})
}
});

dddesign
23 Sep 2010, 11:29 PM
hi aaron,
not exactly like this. I have a splitbutton (enabled) with some buttons (each disabled or enabled). if a click a disabled button of the enabled splitbutton the function don't get called (as expected) but the button itself gets highlighted. see this example:


Ext.setup({
onReady: function() {
var tapMe = function(){alert();};
var splitBtn = new Ext.SplitButton({
id: 'split',
allowMultiple: false,
items: [{
text: 'Option 1',
handler: tapMe
},{
text: 'Option 2',
handler: tapMe,
disabled: true,
},{
text: 'Option 3',
handler: tapMe
}]
});
new Ext.Panel({
fullscreen: true,
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [splitBtn]
}]
})
}
});

aconran
24 Sep 2010, 8:45 AM
dddesign - Thanks for the report. This will be resolved in 0.96 (targeted Sept 28).