1
2
3
4
5
6
| //>>built
| define("dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/_base/html dojo/_base/event dojo/keys ../_Plugin ../../EnhancedGrid".split(" "),function(d,g,e,f,h,k,l,m){d=d("dojox.grid.enhanced.plugins.Menu",l,{name:"menus",types:["headerMenu","rowMenu","cellMenu","selectedRegionMenu"],constructor:function(){var a=this.grid;a.showMenu=e.hitch(a,this.showMenu);a._setRowMenuAttr=e.hitch(this,"_setRowMenuAttr");a._setCellMenuAttr=e.hitch(this,"_setCellMenuAttr");a._setSelectedRegionMenuAttr=e.hitch(this,
| "_setSelectedRegionMenuAttr")},onStartUp:function(){var a,b=this.option;for(a in b)0<=g.indexOf(this.types,a)&&b[a]&&this._initMenu(a,b[a])},_initMenu:function(a,b){var c=this.grid;!c[a]&&(b=this._getMenuWidget(b))&&(c.set(a,b),"headerMenu"!=a?b._scheduleOpen=function(){}:c.setupHeaderMenu())},_getMenuWidget:function(a){return a instanceof dijit.Menu?a:dijit.byId(a)},_setRowMenuAttr:function(a){this._setMenuAttr(a,"rowMenu")},_setCellMenuAttr:function(a){this._setMenuAttr(a,"cellMenu")},_setSelectedRegionMenuAttr:function(a){this._setMenuAttr(a,
| "selectedRegionMenu")},_setMenuAttr:function(a,b){var c=this.grid,d=c.domNode;a&&a instanceof dijit.Menu?(c[b]&&c[b].unBindDomNode(d),c[b]=a,c[b].bindDomNode(d)):console.warn(b," of Grid ",c.id," is not existed!")},showMenu:function(a){if((a.cellNode&&f.hasClass(a.cellNode,"dojoxGridRowSelected")||a.rowNode&&(f.hasClass(a.rowNode,"dojoxGridRowSelected")||f.hasClass(a.rowNode,"dojoxGridRowbarSelected")))&&this.selectedRegionMenu)this.onSelectedRegionContextMenu(a);else{var b={target:a.target,coords:a.keyCode!==
| k.F10&&"pageX"in a?{x:a.pageX,y:a.pageY}:null};this.rowMenu&&(!this.cellMenu||this.selection.isSelected(a.rowIndex)||a.rowNode&&f.hasClass(a.rowNode,"dojoxGridRowbar"))?this.rowMenu._openMyself(b):this.cellMenu&&this.cellMenu._openMyself(b);h.stop(a)}},destroy:function(){var a=this.grid;a.headerMenu&&a.headerMenu.unBindDomNode(a.viewsHeaderNode);a.rowMenu&&a.rowMenu.unBindDomNode(a.domNode);a.cellMenu&&a.cellMenu.unBindDomNode(a.domNode);a.selectedRegionMenu&&a.selectedRegionMenu.destroy();this.inherited(arguments)}});
| m.registerPlugin(d);return d});
|
|