12 |
- //>>built
- define("pd/widgets/grid/IndirectSelection",["dojo/_base/declare","dojo/dom","dojo/dom-attr","dojo/_base/array","dojo/_base/lang","dojo/string","dojox/grid/EnhancedGrid","dojox/grid/enhanced/plugins/IndirectSelection"],function(_1,_2,_3,_4,_5,_6,_7){var _8=_1("pd/widgets/grid/cells/RowSelector",[dojox.grid.cells.RowSelector],{formatter:function(_9,_a,_b){_b.toggleRow(_a,!(_9=="true"));var _c=_b;var _d=_c.baseClass;var _e=_c.getValue(_a);var _f=!!_c.disabledMap[_a];if(_e){_d+=_c.checkedClass;if(_f){_d+=_c.checkedDisabledClass;}}else{if(_f){_d+=_c.disabledClass;}}return ["<div tabindex = -1 ","id = '"+_c.grid.id+"_rowSelector_"+_a+"' ","name = '"+_c.grid.id+"_rowSelector' class = '"+_d+"' ","role = 'button' aria-pressed = '"+_e+"' aria-disabled = '"+_f+"' aria-label = '"+_6.substitute(_c.grid._nls["indirectSelection"+_c.inputType],[_a+1])+"'>","<span class = '"+_c.statusTextClass+"'>"+(_e?_c.checkedText:_c.unCheckedText)+"</span>","</div>"].join("");},_toggleCheckedStyle:function(_10,_11){this.inherited(arguments);var _12=this._getSelector(_10);if(_12){if(_10==-1){_12.setAttribute("title",this._getHeaderSelectorTooltip());}}}});var _13=_1("pd/widgets/grid/cells/pd/widgets/grid/cells/RowSelector",[dojox.grid.cells.SingleRowSelector,_8],{});var _14=_1("pd/widgets/grid/cells/MultipleRowSelector",[dojox.grid.cells.MultipleRowSelector,_8],{_selectRow:function(e){this.inherited(arguments);if(this.grid.selection.selected[e.rowIndex]){this.grid.pdToggleColumn({index:e.rowIndex,hidden:false});}},_getHeaderSelectorTooltip:function(){return this.getValue(-1)?PDMSG.IPT.IDS_IPT_TOOLTIP_EXCLUDE_ALL:PDMSG.IPT.IDS_IPT_TOOLTIP_INCLUDE_ALL;},_addHeaderSelector:function(){this.inherited(arguments);var _15=this.view.getHeaderCellNode(this.index);var _16=_2.byId(this.grid.id+"_rowSelector_-1");_3.set(_16,"title",this._getHeaderSelectorTooltip());_3.set(_16,"role","button");}});var _17=_1("pd/widgets/grid/IndirectSelection",[dojox.grid.enhanced.plugins.IndirectSelection],{addRowSelectCell:function(_18){if(!this.grid.indirectSelection||this.grid.selectionMode=="none"){return;}var _19=false;var _1a=["get","formatter","fields"];var _1b={type:_14,name:"",width:"30px",styles:"text-align: center;",noresize:true};if(_18.headerSelector){_18.name="";}if(this.grid.rowSelectCell){this.grid.rowSelectCell.destroy();}_4.forEach(this.structure,function(_1c){var _1d=_1c.cells;if(_1d&&_1d.length>0&&!_19){var _1e=_1d[0];if(_1e[0]&&_1e[0].isRowSelector){_19=true;return;}var _1f;var _20=this.grid.selectionMode=="single"?_13:_14;_1f=_5.mixin(_1b,_18,{type:_20,editable:false,notselectable:true,filterable:false,navigatable:true,nosort:true});_4.forEach(_1a,function(_21){if(_21 in _1f){delete _1f[_21];}});if(_1d.length>1){_1f.rowSpan=_1d.length;}_4.forEach(this.cells,function(_22,i){if(_22.index>=0){_22.index+=1;}});var _23=this.addCellDef(0,0,_1f);_23.index=0;_1e.unshift(_23);this.cells.unshift(_23);this.grid.rowSelectCell=_23;_19=true;}},this);this.cellCount=this.cells.length;}});_7.registerPlugin(_17,{"preInit":true});return _17;});
|