//>>built
define("dojox/grid/_Selector","../main,dojo/_base/declare,dojo/_base/lang,dojo/query,dojo/dom-class,./Selection,./_View,./_Builder,./util".split(","),function(e,f,c,l,i,j,g,d,k){var j=e.grid._InputSelectorHeaderBuilder=c.extend(function(a){d._HeaderBuilder.call(this,a)},d._HeaderBuilder.prototype,{generateHtml:function(){var a=this.view.contentWidth||0,b=this.view.grid.selection.getSelectedCount();return'<table style="width:'+a+'px;" border="0" cellspacing="0" cellpadding="0" role="presentation"><tr><th style="text-align: center;"><div class="dojoxGridCheckSelector dijitReset dijitInline dijitCheckBox'+
(b&&b==this.view.grid.rowCount?" dijitCheckBoxChecked dijitChecked":"")+'"></div></th></tr></table>'},doclick:function(){var a=this.view.grid.selection.getSelectedCount();this.view._selectionChanging=!0;a==this.view.grid.rowCount?this.view.grid.selection.deselectAll():this.view.grid.selection.selectRange(0,this.view.grid.rowCount-1);this.view._selectionChanging=!1;this.view.onSelectionChanged();return!0}}),h=e.grid._SelectorContentBuilder=c.extend(function(a){d._ContentBuilder.call(this,a)},d._ContentBuilder.prototype,
{generateHtml:function(a,b){return'<table class="dojoxGridRowbarTable" style="width:'+(this.view.contentWidth||0)+'px;" border="0" cellspacing="0" cellpadding="0" role="presentation"><tr><td  style="text-align: center;" class="dojoxGridRowbarInner">'+this.getCellContent(b)+"</td></tr></table>"},getCellContent:function(){return"&nbsp;"},findTarget:function(){return d._ContentBuilder.prototype.findTarget.apply(this,arguments)},domouseover:function(a){this.view.grid.onMouseOverRow(a)},domouseout:function(a){if(!this.isIntraRowEvent(a))this.view.grid.onMouseOutRow(a)},
doclick:function(a){var a=a.rowIndex,b=this.view.grid.selection.mode;this.view.grid.selection.isSelected(a)?this.view.grid.selection.deselect(a):"single"==b?this.view.grid.selection.select(a):"none"!=b&&this.view.grid.selection.addToSelection(a);return!0}}),e=e.grid._InputSelectorContentBuilder=c.extend(function(a){h.call(this,a)},h.prototype,{getCellContent:function(a){var b=this.view,c="checkbox"==b.inputType?"CheckBox":"Radio",a=b.grid.selection.isSelected(a)?" dijit"+c+"Checked dijitChecked":
"";return'<div class="dojoxGridCheckSelector dijitReset dijitInline dijit'+c+a+'"></div>'}}),c=f("dojox.grid._Selector",g,{inputType:"",selectionMode:"",defaultWidth:"2em",noscroll:!0,padBorderWidth:2,_contentBuilderClass:h,postCreate:function(){this.inherited(arguments);if(this.selectionMode)this.grid.selection.mode=this.selectionMode;this.connect(this.grid.selection,"onSelected","onSelected");this.connect(this.grid.selection,"onDeselected","onDeselected")},buildRendering:function(){this.inherited(arguments);
this.scrollboxNode.style.overflow="hidden"},getWidth:function(){return this.viewWidth||this.defaultWidth},resize:function(){this.adaptHeight()},setStructure:function(a){this.inherited(arguments);if(a.defaultWidth)this.defaultWidth=a.defaultWidth},adaptWidth:function(){if(!("contentWidth"in this)&&this.contentNode)this.contentWidth=this.contentNode.offsetWidth-this.padBorderWidth},doStyleRowNode:function(a,b){var c=["dojoxGridRowbar dojoxGridNonNormalizedCell"];this.grid.rows.isOver(a)&&c.push("dojoxGridRowbarOver");
this.grid.selection.isSelected(a)&&c.push("dojoxGridRowbarSelected");b.className=c.join(" ")},onSelected:function(a){this.grid.updateRow(a)},onDeselected:function(a){this.grid.updateRow(a)}});if(!g.prototype._headerBuilderClass&&!g.prototype._contentBuilderClass)c.prototype.postCreate=function(){this.connect(this.scrollboxNode,"onscroll","doscroll");k.funnelEvents(this.contentNode,this,"doContentEvent","mouseover,mouseout,click,dblclick,contextmenu,mousedown".split(","));k.funnelEvents(this.headerNode,
this,"doHeaderEvent","dblclick,mouseover,mouseout,mousemove,mousedown,click,contextmenu".split(","));this.content=this._contentBuilderClass?new this._contentBuilderClass(this):new d._ContentBuilder(this);this.header=this._headerBuilderClass?new this._headerBuilderClass(this):new d._HeaderBuilder(this);if(!this.grid.isLeftToRight())this.headerNodeContainer.style.width="";this.connect(this.grid.selection,"onSelected","onSelected");this.connect(this.grid.selection,"onDeselected","onDeselected")};f("dojox.grid._RadioSelector",
c,{inputType:"radio",selectionMode:"single",_contentBuilderClass:e,buildRendering:function(){this.inherited(arguments);this.headerNode.style.visibility="hidden"},renderHeader:function(){}});f("dojox.grid._CheckBoxSelector",c,{inputType:"checkbox",_headerBuilderClass:j,_contentBuilderClass:e,postCreate:function(){this.inherited(arguments);this.connect(this.grid,"onSelectionChanged","onSelectionChanged");this.connect(this.grid,"updateRowCount","_updateVisibility")},renderHeader:function(){this.inherited(arguments);
this._updateVisibility(this.grid.rowCount)},_updateVisibility:function(a){this.headerNode.style.visibility=a?"":"hidden"},onSelectionChanged:function(){if(!this._selectionChanging){var a=l(".dojoxGridCheckSelector",this.headerNode)[0],b=this.grid,c=b.rowCount&&b.rowCount==b.selection.getSelectedCount();b.allItemsSelected=c||!1;i.toggle(a,"dijitChecked",b.allItemsSelected);i.toggle(a,"dijitCheckBoxChecked",b.allItemsSelected)}}});return c});