//>>built define("../main dojo/_base/declare dojo/_base/lang dojo/query dojo/dom-class ./Selection ./_View ./_Builder ./util".split(" "),function(f,g,d,p,l,m,h,e,n){m=f.grid._InputSelectorHeaderBuilder=d.extend(function(a){e._HeaderBuilder.call(this,a)},e._HeaderBuilder.prototype,{generateHtml:function(){var a=this.view.contentWidth||0,b=this.view.grid.selection.getSelectedCount();return'\x3ctable style\x3d"width:'+a+'px;" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"\x3e\x3ctr\x3e\x3cth style\x3d"text-align: center;"\x3e\x3cdiv class\x3d"dojoxGridCheckSelector dijitReset dijitInline dijitCheckBox'+ (b&&b==this.view.grid.rowCount?" dijitCheckBoxChecked dijitChecked":"")+'"\x3e\x3c/div\x3e\x3c/th\x3e\x3c/tr\x3e\x3c/table\x3e'},doclick:function(a){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}});var k=f.grid._SelectorContentBuilder=d.extend(function(a){e._ContentBuilder.call(this, a)},e._ContentBuilder.prototype,{generateHtml:function(a,b){return'\x3ctable class\x3d"dojoxGridRowbarTable" style\x3d"width:'+(this.view.contentWidth||0)+'px;" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd style\x3d"text-align: center;" class\x3d"dojoxGridRowbarInner"\x3e'+this.getCellContent(b)+"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e"},getCellContent:function(a){return"\x26nbsp;"},findTarget:function(){return e._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){a=a.rowIndex;var b=this.view.grid.selection.isSelected(a),c=this.view.grid.selection.mode;b?this.view.grid.selection.deselect(a):"single"==c?this.view.grid.selection.select(a):"none"!=c&&this.view.grid.selection.addToSelection(a);return!0}});f=f.grid._InputSelectorContentBuilder=d.extend(function(a){k.call(this,a)},k.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'\x3cdiv class\x3d"dojoxGridCheckSelector dijitReset dijitInline dijit'+c+a+'"\x3e\x3c/div\x3e'}});d=g("dojox.grid._Selector",h,{inputType:"",selectionMode:"",defaultWidth:"2em",noscroll:!0,padBorderWidth:2,_contentBuilderClass:k,postCreate:function(){this.inherited(arguments);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);a.defaultWidth&&(this.defaultWidth=a.defaultWidth)},adaptWidth:function(){"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)}});h.prototype._headerBuilderClass||h.prototype._contentBuilderClass||(d.prototype.postCreate=function(){this.connect(this.scrollboxNode, "onscroll","doscroll");n.funnelEvents(this.contentNode,this,"doContentEvent","mouseover mouseout click dblclick contextmenu mousedown".split(" "));n.funnelEvents(this.headerNode,this,"doHeaderEvent","dblclick mouseover mouseout mousemove mousedown click contextmenu".split(" "));this.content=this._contentBuilderClass?new this._contentBuilderClass(this):new e._ContentBuilder(this);this.header=this._headerBuilderClass?new this._headerBuilderClass(this):new e._HeaderBuilder(this);this.grid.isLeftToRight()|| (this.headerNodeContainer.style.width="");this.connect(this.grid.selection,"onSelected","onSelected");this.connect(this.grid.selection,"onDeselected","onDeselected")});g("dojox.grid._RadioSelector",d,{inputType:"radio",selectionMode:"single",_contentBuilderClass:f,buildRendering:function(){this.inherited(arguments);this.headerNode.style.visibility="hidden"},renderHeader:function(){}});g("dojox.grid._CheckBoxSelector",d,{inputType:"checkbox",_headerBuilderClass:m,_contentBuilderClass:f,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=p(".dojoxGridCheckSelector",this.headerNode)[0],b=this.grid,c=b.rowCount&&b.rowCount==b.selection.getSelectedCount();b.allItemsSelected= c||!1;l.toggle(a,"dijitChecked",b.allItemsSelected);l.toggle(a,"dijitCheckBoxChecked",b.allItemsSelected)}}});return d});