1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- require({cache:{
- 'url:dijit/templates/CheckedMenuItem.html':"<tr class=\"dijitReset dijitMenuItem\" data-dojo-attach-point=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\"\n\t\tdata-dojo-attach-event=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" data-dojo-attach-point=\"iconNode\"/>\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">✓</span>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" data-dojo-attach-point=\"containerNode,labelNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" data-dojo-attach-point=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\"> </td>\n</tr>\n"}});
- define("dijit/CheckedMenuItem", [
- "dojo/_base/declare", // declare
- "dojo/dom-class", // domClass.toggle
- "./MenuItem",
- "dojo/text!./templates/CheckedMenuItem.html",
- "./hccss"
- ], function(declare, domClass, MenuItem, template){
- /*=====
- var MenuItem = dijit.MenuItem;
- =====*/
- // module:
- // dijit/CheckedMenuItem
- // summary:
- // A checkbox-like menu item for toggling on and off
- return declare("dijit.CheckedMenuItem", MenuItem, {
- // summary:
- // A checkbox-like menu item for toggling on and off
- templateString: template,
- // checked: Boolean
- // Our checked state
- checked: false,
- _setCheckedAttr: function(/*Boolean*/ checked){
- // summary:
- // Hook so attr('checked', bool) works.
- // Sets the class and state for the check box.
- domClass.toggle(this.domNode, "dijitCheckedMenuItemChecked", checked);
- this.domNode.setAttribute("aria-checked", checked);
- this._set("checked", checked);
- },
- iconClass: "", // override dijitNoIcon
- onChange: function(/*Boolean*/ /*===== checked =====*/){
- // summary:
- // User defined function to handle check/uncheck events
- // tags:
- // callback
- },
- _onClick: function(/*Event*/ e){
- // summary:
- // Clicking this item just toggles its state
- // tags:
- // private
- if(!this.disabled){
- this.set("checked", !this.checked);
- this.onChange(this.checked);
- }
- this.inherited(arguments);
- }
- });
- });
|