CheckItem fires a beforecheckchange event when the item is initially checked.
Example:
new Ext.Button({
text: 'Click me',
menu: [{
text: 'Item',
checked: true,
listeners: {
beforecheckchange: function(){
console.log('Don't call me');
}
}
}],
renderTo: Ext.getBody()
});
Suggested fix:
Ext.override(Ext.menu.CheckItem, {
setChecked : function(state, suppressEvent){
if(this.checked != state &&
(suppressEvent === true || this.fireEvent("beforecheckchange", this, state) !== false)){
if(this.container){
this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
}
this.checked = state;
if(suppressEvent !== true){
this.fireEvent("checkchange", this, state);
}
}
}
});