-<html>\r
-<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js"><div id="cls-Ext.menu.CheckItem"></div>/**
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
+ */
+<div id="cls-Ext.menu.CheckItem"></div>/**
* @class Ext.menu.CheckItem
* @extends Ext.menu.Item
* Adds a menu item that contains a checkbox by default, but can also be part of a radio group.
<div id="cfg-Ext.menu.CheckItem-checked"></div>/**
* @cfg {Boolean} checked True to initialize this checkbox as checked (defaults to false). Note that
- * if this checkbox is part of a radio group (group = true) only the last item in the group that is
+ * if this checkbox is part of a radio group (group = true) only the first item in the group that is
* initialized with checked = true will be rendered as checked.
*/
checked: false,
* @param {Boolean} suppressEvent (optional) True to prevent the checkchange event from firing (defaults to false)
*/
setChecked : function(state, suppressEvent){
- if(this.checked != state && this.fireEvent("beforecheckchange", this, state) !== false){
+ var suppress = suppressEvent === true;
+ if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){
+ Ext.menu.MenuMgr.onCheckChange(this, state);
if(this.container){
this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
}
this.checked = state;
- if(suppressEvent !== true){
+ if(!suppress){
this.fireEvent("checkchange", this, state);
}
}
Ext.menu.CheckItem.superclass.handleClick.apply(this, arguments);
}
});
-Ext.reg('menucheckitem', Ext.menu.CheckItem);</pre> \r
-</body>\r
+Ext.reg('menucheckitem', Ext.menu.CheckItem);</pre>
+</body>
</html>
\ No newline at end of file