/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 14.1.20141.1020
 *
 * Copyright (c) 2011-2014 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.4.4.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridRowSelectors",{options:{enableRowNumbering:true,enableCheckBoxes:false,rowNumberingSeed:0,rowSelectorColumnWidth:null,requireSelection:true,showCheckBoxesOnFocus:false},css:{rowSelector:"ui-iggrid-rowselector-class",rowSelectorSelected:"ui-iggrid-selectedcell ui-state-active",headerRowSelector:"ui-iggrid-rowselector-header",footerRowSelector:"ui-iggrid-rowselector-footer",checkBox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkBoxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkBoxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",nodeHovered:"ui-state-hover"},events:{rowSelectorClicked:"rowSelectorClicked",checkBoxStateChanging:"checkBoxStateChanging",checkBoxStateChanged:"checkBoxStateChanged"},_createWidget:function(options,element){$.Widget.prototype._createWidget.apply(this,arguments);if(this.options.rowSelectorColumnWidth===null){this.options.rowSelectorColumnWidth=55;if(this.options.enableCheckBoxes===true&&this.options.enableRowNumbering===true){this.options.rowSelectorColumnWidth+=15}}},_create:function(){this._cIdx=0;this._functionsRedirected=false;this._hovTR=null;this._gridRenderRecord=null;this._gridRenderRecordInArray=null;this._checkBoxesShown=false;this._nTmpl="{{html ig_rs_idx}}";this._sTmpl="{{if ${ig_rs_sel} === true}}"+this.css.rowSelectorSelected+"{{/if}}";this._v=false;this._ms=false},destroy:function(){this._unregisterEvents();this._unregisterCellEvents();if(this._gridRenderRecordHandler!==undefined){this.grid._renderColgroup=this._flatRenderColgroup;this.grid._renderRecord=this._gridRenderRecordHandler;this.grid._renderRecordInArray=this._gridRenderRecordInArrayHandler}if(this.options.enableCheckBoxes===true){this._unregisterCheckBoxEvents()}this._cleanInterface(false);$.Widget.prototype.destroy.call(this);return this},_renderHeaderRowSelectors:function(owner){var rows,i,cell,header,$thDataSkip;if(owner.id()!==this.grid.id()){return}rows=this.grid.headersTable().children("thead").children();if(rows.length>0){cell=rows.eq(0).find("th.ui-iggrid-expandheadercell").first();if(cell.length===0){this._index=0}else{this._index=cell.index()+1}if(this.grid._isMultiColumnGrid){$thDataSkip=$("<th></th>").prependTo(this.grid.headersTable().find("thead tr:nth-child(1)")).addClass(this.css.headerRowSelector).addClass(this.grid.css.headerClass).attr("data-role","rs").attr("data-skip","true");$thDataSkip.attr("rowspan",this.grid._maxLevel+1);if(this.options.enableCheckBoxes===true&&this._ms){$(this._getCheckBox(true)).appendTo($thDataSkip)}}else{for(i=0;i<rows.length;i++){if(rows.eq(i).find("th[data-role='rs']").length>0){continue}header=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelector).addClass(i===0?this.grid.css.headerClass:"").attr("data-role","rs").attr("data-skip","true").insertBefore(rows.eq(i).children().eq(this._index));if(this.options.enableCheckBoxes===true&&i===0&&this._ms){$(this._getCheckBox(true)).appendTo(header)}}}}},_renderFooterRowSelectors:function(owner){var rows,i;if(owner.id()!==this.grid.id()){return}rows=this.grid.footersTable().children("tfoot").children();if(rows.length>0){for(i=0;i<rows.length;i++){if(rows.eq(i).find("td[data-role='rs']").length>0){continue}$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelector).attr("data-role","rs").attr("data-skip","true").insertBefore(rows.eq(i).children().eq(this._index))}}},_headerRendered:function(event,ui){this._ms=!this._skipRefresh&&this.grid.element.igGridSelection("option","multipleSelection")===true;this._renderHeaderRowSelectors(ui.owner);this._getColumnFixingInstance()},_footerRendered:function(event,ui){this._renderFooterRowSelectors(ui.owner)},_getColumnFixingInstance:function(){if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}return this._columnFixing},_recordsRendering:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}this._cIdx=ui.vrtWnd.start&&ui.vrtWnd.end?ui.vrtWnd.start:0;if(this._functionsRedirected===false){this._renderRecordHandler=$.proxy(this._rsRenderRecord,this);this._renderRecordInArrayHandler=$.proxy(this._rsRenderRecordInArray,this);this._gridRenderRecordHandler=$.proxy(this.grid._renderRecord,this.grid);this._gridRenderRecordInArrayHandler=$.proxy(this.grid._renderRecordInArray,this.grid);this._gridRenderRecord=this._gridRenderRecordHandler;this._gridRenderRecordInArray=this._gridRenderRecordInArrayHandler;this.grid._renderRecord=this._renderRecordHandler;this.grid._renderRecordInArray=this._renderRecordInArrayHandler}this._functionsRedirected=true},_recordsRendered:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents();this._updateHeader()}},_gridRendered:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}this._ms=!this._skipRefresh&&this.grid.element.igGridSelection("option","multipleSelection")===true;this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_rsRenderColgroup:function(flatRenderColgroup,rs,table,isHeader,isFooter,autofitLastColumn){var cf;flatRenderColgroup.apply(this,[table,isHeader,isFooter,autofitLastColumn]);if(rs.grid.hasFixedColumns()){cf=rs._getColumnFixingInstance();if(cf.options.fixingDirection==="left"){return}}rs._rsRenderColgroupHelper(table)},_rsRenderColgroupHelper:function(table){var cgrp;cgrp=$(table).find("colgroup");if(cgrp.find("col[data-role='rs']").length===0){$("<col></col>").prependTo(cgrp).css("width",this.options.rowSelectorColumnWidth).attr("data-skip","true").attr("data-role","rs")}},_rsRenderFixedColgroup:function(isHeader,isFooter,autofitLastColumn){var cf=this._columnFixing,table;this._renderFixedColgroupHandler(isHeader,isFooter,autofitLastColumn);if(!cf||cf.options.fixingDirection!=="left"){return}if(isHeader){table=cf._containers.header.fixedTable||cf._containers.body.fixedTable}else if(isFooter){table=cf._containers.footer.fixedTable||cf._containers.body.fixedTable}else{table=cf._containers.body.fixedTable}this._rsRenderColgroupHelper(table)},_rsRenderFixedRecord:function(data,rowIndex){var markup=this._renderFixedRecordHandler(data,rowIndex),pre,app,idx,rs=this._getRowSelectorCellMarkup(false,markup.indexOf("ui-iggrid-selectedcell")!==-1);idx=markup.indexOf("ui-iggrid-expandcolumn");if(idx>=0){app=markup.substr(idx);idx=idx+app.indexOf("</td>")+4;pre=markup.substring(0,idx+1);app=markup.substring(idx+1)}else{idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx)}markup=pre+rs+app;return markup},_rsRenderRecord:function(data,rowIndex){var markup=this._gridRenderRecord(data,rowIndex),pre,app,idx,rs=this._getRowSelectorCellMarkup(false,markup.indexOf("ui-iggrid-selectedcell")!==-1);idx=markup.indexOf("ui-iggrid-expandcolumn");if(idx>=0){app=markup.substr(idx);idx=idx+app.indexOf("</td>")+4;pre=markup.substring(0,idx+1);app=markup.substring(idx+1)}else{idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx)}markup=pre+rs+app;return markup},_rsRenderRecordInArray:function(darr,tbody,data,rowIndex){var i,j,sel=false;this._gridRenderRecordInArray(darr,tbody,data,rowIndex);for(i=darr.length-1;i>=0;i--){if(darr[i].indexOf&&darr[i].indexOf("<tr")!==-1){for(j=i;j<darr.length;j++){if(darr[j].indexOf&&darr[j].indexOf("ui-iggrid-selectedcell")!==-1){sel=true;break}}for(j=i;j<darr.length;j++){if(darr[j].indexOf&&darr[j].indexOf("<td")!==-1){if(darr[j].indexOf("ui-iggrid-expandcolumn")!==-1){darr[j]+=this._getRowSelectorCellMarkup(false,sel);sel=false;break}darr[j]=this._getRowSelectorCellMarkup(false,sel)+darr[j];sel=false;break}}break}}},_renderExtraHeaderCells:function(row,colgroup,prepend){this._renderExtraCells(row,colgroup,prepend,true)},_renderExtraFooterCells:function(row,colgroup,prepend,cssClass){this._renderExtraCells(row,colgroup,prepend,false,cssClass)},_renderExtraCells:function(row,colgroup,prepend,header,cssClass){var rHeader,rCol,index,cell;if(row.find("[data-role='rs']").length>0){return}if(header===true){rHeader=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelector).attr("data-role","rs").attr("data-skip","true")}else{rHeader=$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelector).addClass(cssClass).attr("data-role","rs").attr("data-skip","true")}cell=row.find("th.ui-iggrid-expandheadercell");if(cell.length===0){cell=row.children().first();index=0}else{index=cell.index()+1}if(prepend===true||cell.length===0){rHeader.prependTo(row);index=0}else{rHeader.insertBefore(row.children().eq(index))}if(colgroup){rCol=$("<col></col>").attr("data-skip","true").attr("data-role","rs").css("width",this.options.rowSelectorColumnWidth);rCol.insertBefore(colgroup.children().eq(index))}},_registerCellEvents:function(){this._allRowSelectorCells().bind({click:this._rsClickHandler});this.grid.element.children("tbody").bind({mousemove:this._rrHoverHandler,mouseleave:this._rrLeaveHandler})},_unregisterCellEvents:function(){this._allRowSelectorCells().unbind({click:this._rsClickHandler});this.grid.element.children("tbody").unbind({mousemove:this._rrHoverHandler,mouseleave:this._rrLeaveHandler})},_registerCheckBoxEvents:function(){this._allCheckboxes().unbind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});this._headerCheckbox().unbind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler}).bind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler})},_unregisterCheckBoxEvents:function(){this._allCheckboxes().unbind({click:this._checkboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler});this._headerCheckbox().unbind({click:this._hCheckboxClickHandler,mouseover:this._checkboxMouseOverHandler,mouseout:this._checkboxMouseOutHandler})},_checkboxMouseOver:function(event){$(event.target).closest("span[data-role='checkbox']").addClass(this.css.nodeHovered)},_checkboxMouseOut:function(event){$(event.target).closest("span[data-role='checkbox']").removeClass(this.css.nodeHovered)},_checkBoxClicked:function(event){var trg=$(event.target).closest("span[name='chk']"),rCell=trg.parent(),rRow=rCell.parent(),args,rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id"),noCancel,state=trg.attr("data-chk");if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}args={row:rRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:false};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleCheck(trg);this._updateHeader();delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.stopPropagation()},_headerCheckBoxClicked:function(event){var trg=$(event.target).closest("span[name='hchk']"),args,noCancel,state=trg.attr("data-chk");args={owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:true};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleHeaderCheck(trg);delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.stopPropagation();event.preventDefault()},_handleCheck:function(checkbox){var row=checkbox.parent().parent(),idx=this._getVisibleRowIndex(row),rIdx=this._getVisibleHRowIndex(row),offset=0;if(checkbox===undefined||checkbox===null){return}if(this._v===true){offset=this.grid._startRowIndex}if(checkbox.attr("data-chk")==="off"){this._alterCheckbox(checkbox,true);if(!this._ms){this._clearRowSelectorsSelection()}this.grid.element.igGridSelection("selectRow",rIdx+offset)}else{this._alterCheckbox(checkbox,false);this.grid.element.igGridSelection("deselectRow",rIdx+offset)}},_handleHeaderCheck:function(checkbox){var checkBoxes=this._allCheckboxes(),i,vfs,sm;this.grid.element.unbind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);if(checkbox.attr("data-chk")==="off"){this._alterCheckbox(checkbox,true);for(i=0;i<checkBoxes.length;i++){if(checkBoxes.eq(i).attr("data-chk")==="off"){this._handleCheck(checkBoxes.eq(i))}}}else{this._alterCheckbox(checkbox,false);for(i=0;i<checkBoxes.length;i++){if(checkBoxes.eq(i).attr("data-chk")==="on"){this._handleCheck(checkBoxes.eq(i))}}}if(this._v===true){vfs=checkbox.attr("data-chk")==="on"?true:false;sm=vfs?"selectRow":"deselectRow";for(i=0;i<this.grid._startRowIndex;i++){this.grid.element.igGridSelection(sm,i)}for(i=this.grid._startRowIndex+this.grid._virtualRowCount;i<this.grid._totalRowCount;i++){this.grid.element.igGridSelection(sm,i)}}this.grid.element.bind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler)},_updateHeader:function(){var checkboxes=this._allCheckboxes(),header=this._headerCheckbox(),check=true,i;for(i=0;i<checkboxes.length;i++){if(checkboxes.eq(i).attr("data-chk")==="off"){check=false;break}}this._alterCheckbox(header,check)},_alterCheckbox:function(checkbox,check){var inner=checkbox.children().first();if(checkbox.length>0&&inner.length>0){if(check===true){checkbox.attr("data-chk","on");inner.removeClass(this.css.checkBoxOff).addClass(this.css.checkBoxOn)}else{checkbox.attr("data-chk","off");inner.removeClass(this.css.checkBoxOn).addClass(this.css.checkBoxOff)}}},_getRowSelectorCellMarkup:function(template,selected){var markup="";markup+='<th class="'+this.css.rowSelector;if(selected){markup+=" "+this.css.rowSelectorSelected}if(template){markup+=" "+this._sTmpl}markup+='"><span class="ui-icon ui-icon-triangle-1-e" style="margin-left: -5px"></span>';if(this.options.enableRowNumbering){markup+=template===true?this._nTmpl:this._getCurrentNumber()}if(this.options.enableCheckBoxes){markup+=this._getCheckBox(false,selected)}markup+="</th>";return markup},_getCheckBox:function(header,checked){var markup="";markup+='<span name="'+(header===true?"hchk":"chk")+'" ';markup+='data-chk="'+(checked?"on":"off")+'" ';markup+='data-role="checkbox" class="'+this.css.checkBox+' "';if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){markup+=' style="visibility: hidden;"'}markup+='><span class="'+(checked?this.css.checkBoxOn:this.css.checkBoxOff)+'">';markup+="</span></span>";return markup},_getCurrentNumber:function(id){var seed;if(id!==undefined&&id!==null){seed=id}else{seed=++this._cIdx}return'<span class="ui-iggrid-rowselector-row-number">'+(seed+this.options.rowNumberingSeed+this._getStartingIndexForPage())+"</span>"},_getStartingIndexForPage:function(){return this.grid.dataSource.pageIndex()*this.grid.dataSource.pageSize()},_rsRenderVirtualRecords:function(event,ui){var i=0,rs;this._cIdx=0;for(i;i<ui.rows.length;i++){rs=$(this._getRowSelectorCellMarkup());rs.prependTo(ui.rows.eq(i))}this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_rrn:function(event,args){var rs=this._allRowSelectorCells(),cb=this._allCheckboxes(),i=0,self=this,sri=this.grid._startRowIndex||0,trc=this.grid._totalRowCount,sc,sr;if(this.options.enableRowNumbering===true){for(i=0;i<rs.length;i++){rs.eq(i).removeClass(this.css.nodeHovered).children("span.ui-iggrid-rowselector-row-number").text(sri+i+this.options.rowNumberingSeed+1)}}if(!this._skipRefresh){rs.removeClass(this.css.rowSelectorSelected);cb.map(function(){self._alterCheckbox($(this),false)});if(!this._ms){sc=this.grid._selectedCell?[this.grid._selectedCell]:[];sr=this.grid._selectedRow?[this.grid._selectedRow]:[]}else{sc=this.grid._selectedCells;sr=this.grid._selectedRows}for(i=0;i<sc.length;i++){if(sc[i].rowIndex>=sri&&sc[i].rowIndex<sri+trc){rs.eq(sc[i].rowIndex-sri).addClass(this.css.rowSelectorSelected)}}for(i=0;i<sr.length;i++){if(sr[i].index>=sri&&sr[i].index<sri+trc){rs.eq(sr[i].index-sri).addClass(this.css.rowSelectorSelected);if(this.options.enableCheckBoxes===true){this._alterCheckbox(cb.eq(sr[i].index-sri),true)}}}}},_cSelectionChanged:function(event,ui){var cells,cog=false;if(ui.owner.grid.id()!==this.grid.id()){cog=true}if(!this._ms){cells=[this.grid._selectedCell]}else{cells=ui.selectedCells}this._selectionChanged(this.grid._selectedRows,cells,cog)},_rSelectionChanged:function(event,ui){var rows,cog=false;if(ui.owner.grid.id()!==this.grid.id()){cog=true}if(!this._ms){rows=[this.grid._selectedRow]}else{rows=ui.selectedRows}if(this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){if(ui.selectedFixedRows.length===0){rows=[this.grid._selectedFixedRow]}else{rows=ui.selectedFixedRows}this._selectionChanged(rows,this.grid._selectedFixedCells,cog)}else{this._selectionChanged(rows,this.grid._selectedCells,cog)}},_selectionChanged:function(selRows,selCells,selectedOtherGrid){var i,row,cell,rowInRange,rowSelector,checkbox,selRow,selCell;this._clearRowSelectorsSelection();if(selectedOtherGrid===true){return}if(this._checkBoxesShown===false&&this.options.showCheckBoxesOnFocus===true){this._animateCheckboxes(true)}for(i=0;i<selRows.length;i++){selRow=selRows[i];rowInRange=true;if(this._v===true){rowInRange=this.grid._startRowIndex<=selRow.index&&selRow.index<this.grid._startRowIndex+this.grid._virtualRowCount}row=selRow.element;if(row.length>0&&rowInRange){rowSelector=row.children("th");if(!rowSelector.hasClass(this.css.rowSelectorSelected)){rowSelector.addClass(this.css.rowSelectorSelected)}if(this.options.enableCheckBoxes===true){checkbox=rowSelector.find("span[name='chk']");this._alterCheckbox(checkbox,true)}}}for(i=0;i<selCells.length;i++){selCell=selCells[i];rowInRange=true;if(this._v===true){rowInRange=this.grid._startRowIndex<=selCell.rowIndex&&selCell.rowIndex<this.grid._startRowIndex+this.grid._virtualRowCount}cell=selCell.element;if(cell.length>0&&rowInRange){rowSelector=cell.siblings("th");if(!rowSelector.hasClass(this.css.rowSelectorSelected)){rowSelector.addClass(this.css.rowSelectorSelected)}}}this._updateHeader()},_clearSelection:function(evt,ui){if(ui.owner.id()===this.grid.id()){this._clearRowSelectorsSelection()}},_clearRowSelectorsSelection:function(){var checkboxes,cb;this._allRowSelectorCells().removeClass(this.css.rowSelectorSelected);checkboxes=this.options.enableCheckBoxes?this._allCheckboxes():[];for(i=0;i<checkboxes.length;i++){cb=checkboxes.eq(i);if(cb.attr("data-chk")==="on"){this._alterCheckbox(cb,false)}}if(checkboxes.length>0){this._updateHeader()}},_cellClick:function(event,ui){var args,target=$(event.target),fRow,rCell=target.closest("th"),rRow=rCell.parent(),rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id");if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){this._animateCheckboxes(true)}if(target.is("span")&&target.attr("unselectable")){return}if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}if(this.grid.hasFixedColumns()){if(this.grid._isFixedElement(rCell)){fRow=rRow;rRow=this.grid.scrollContainer().find("tbody > tr").eq(rRow.index())}else{fRow=this.grid.fixedContainer().find("tbody > tr").eq(rRow.index())}}args={row:rRow,fixedRow:fRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid};this._triggerClickEvent(event,args)},_mouseHoverRow:function(event,ui){var par,tag,tr=event.target;while(tr){par=tr.parentNode;tag=tr.nodeName;if(tag==="TR"&&par.nodeName==="TBODY"){break}tr=tag==="TABLE"?null:par}if(this._hovTR!==tr){if(this._hovTR&&$(this._hovTR).attr("data-container")!=="true"){$("th."+this.css.rowSelector,this._hovTR).removeClass(this.css.nodeHovered)}if(tr&&$(tr).attr("data-container")!=="true"){$("th."+this.css.rowSelector,tr).addClass(this.css.nodeHovered)}this._hovTR=tr}},_mouseLeaveRow:function(event,ui){if(this._hovTR){$("th",this._hovTR).removeClass(this.css.nodeHovered);this._hovTR=null}},_triggerClickEvent:function(event,args){this._trigger(this.events.rowSelectorClicked,event,args)},_triggerCheckingEvent:function(event,args){return this._trigger(this.events.checkBoxStateChanging,event,args)},_triggerCheckedEvent:function(event,args){this._trigger(this.events.checkBoxStateChanged,event,args)},_getVisibleRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'])").index(row)},_getVisibleHRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'])").index(row)},_animateCheckboxes:function(trans){var h=this._headerCheckbox(),c=this._allCheckboxes(),all=h.add(c);if(trans===true){all.css("visibility","visible").css("opacity",0).animate({opacity:1},1e3)}else{all.css("opacity",1e3).animate({opacity:0},1e3,function(){$(this).css("visibility","hidden")})}this._checkBoxesShown=trans},_newRowAdded:function(event,ui){this._unregisterCellEvents();this._registerCellEvents();if(this.options.enableCheckBoxes===true){this._registerCheckBoxEvents()}},_resetIndexing:function(){this._cIdx=0},_cleanInterface:function(isRebind){var header,footer,cols,rsCells,w;if(isRebind===true){this._alterCheckbox(this._headerCheckbox(),false);return}cols=this.grid.element.children("colgroup").children("[data-role='rs']");cols=cols.add(this.grid.fixedContainer().find("colgroup").children("[data-role='rs']"));if(this.grid.options.fixedHeaders===true){cols=cols.add(this.grid.headersTable().children("colgroup").children("[data-role='rs']"));cols=cols.add(this.grid.fixedHeadersTable().children("colgroup").children("[data-role='rs']"))}if(this.grid.options.fixedFooters===true){cols=cols.add(this.grid.footersTable().children("colgroup").children("[data-role='rs']"));cols=cols.add(this.grid.fixedFootersTable().children("colgroup").children("[data-role='rs']"))}footer=this._footerRowSelectorCells();header=this._headerRowSelectorCells();rsCells=this._allRowSelectorCells();if(!this.grid.options.width&&this._functionsRedirected){w=this.grid.container().css("width");if(w&&!w.endsWith("%")){this.grid.container().css("width",parseInt(w,10)-this.options.rowSelectorColumnWidth)}}cols.remove();footer.remove();header.remove();rsCells.remove()},_allRowSelectorCells:function(){var rowSelectors=this.grid.element.children("tbody").children("tr").children("th."+this.css.rowSelector);if(rowSelectors.length===0&&this.grid.hasFixedColumns()){rowSelectors=this.grid.fixedContainer().find("tbody > tr > th."+this.css.rowSelector)}return rowSelectors},_headerRowSelectorCells:function(){var headerCells=this.grid.headersTable().children("thead").find("th[data-role='rs']");if(headerCells.length===0&&this.grid.hasFixedColumns()){headerCells=this.grid.fixedHeadersTable().children("thead").find("th[data-role='rs']")}return headerCells},_footerRowSelectorCells:function(){var footerCells=this.grid.footersTable().children("tfoot").find("td[data-role='rs']");if(footerCells.length===0&&this.grid.hasFixedColumns()){footerCells=this.grid.fixedFootersTable().children("tfoot").find("td[data-role='rs']")}return footerCells},_allCheckboxes:function(){var checkboxes=this.grid.element.children("tbody").children("tr").children("th").find("span[name='chk']");if(checkboxes.length===0&&this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){checkboxes=this.grid.fixedContainer().find("tbody > tr > th span[name='chk']")}return checkboxes},_headerCheckbox:function(){var checkbox=this.grid.headersTable().children("thead").find("tr > th span[name='hchk']");if(checkbox.length===0&&this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){checkbox=this.grid.fixedHeadersTable().children("thead").find("tr > th span[name='hchk']")}return checkbox},_columnFixed:function(args){var columnFixingInstance=this._getColumnFixingInstance(),countFixedCols=args.fixedColsCount;if(!columnFixingInstance){return}if(columnFixingInstance.options.fixingDirection==="right"){return}if(!this._renderFixedColgroupHandler){this._renderFixedColgroupHandler=$.proxy(columnFixingInstance._renderFixedColgroup,columnFixingInstance);columnFixingInstance._renderFixedColgroup=$.proxy(this._rsRenderFixedColgroup,this)}if(!this._isColumnFixingFunctionsRedirected){this._renderFixedRecordHandler=$.proxy(columnFixingInstance._renderFixedRecord,columnFixingInstance);this._isColumnFixingFunctionsRedirected=true}if(args.isFixed){if(args.isInit){this.grid._renderRecord=this._gridRenderRecordHandler;columnFixingInstance._renderFixedRecord=$.proxy(this._rsRenderFixedRecord,this)}}else{if(countFixedCols<=1&&!this.grid.hasFixedDataSkippedColumns()){this.grid._renderRecord=this._renderRecordHandler;columnFixingInstance._renderFixedRecord=this._renderFixedRecordHandler}}},_checkForSelection:function(){var i,isSelection=false;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){isSelection=true;if(this.options.enableCheckBoxes===true){this.grid.options.features[i].mode="row"}break}}if(isSelection===false){if(this.options.requireSelection===true){throw new Error($.ig.GridRowSelectors.locale.selectionNotLoaded)}this._skipRefresh=true}},_createHandlers:function(){this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._footerRenderedHandler=$.proxy(this._footerRendered,this);this._recordsRenderingHandler=$.proxy(this._recordsRendering,this);this._recordsRenderedHandler=$.proxy(this._recordsRendered,this);this._gridRenderedHandler=$.proxy(this._gridRendered,this);this._cellSelectionChangedHandler=$.proxy(this._cSelectionChanged,this);this._rowSelectionChangedHandler=$.proxy(this._rSelectionChanged,this);this._clearSelectionHandler=$.proxy(this._clearSelection,this);this._virtualDomBuiltHandler=$.proxy(this._rsRenderVirtualRecords,this);this._virtualRowsHandler=$.proxy(this._rrn,this);this._groupedColumnsChangingHandler=$.proxy(this._resetIndexing,this);this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this._rsClickHandler=$.proxy(this._cellClick,this);this._rrHoverHandler=$.proxy(this._mouseHoverRow,this);this._rrLeaveHandler=$.proxy(this._mouseLeaveRow,this);this._newRowAddedHandler=$.proxy(this._newRowAdded,this);if(this.options.enableCheckBoxes===true){this._checkboxMouseOverHandler=$.proxy(this._checkboxMouseOver,this);this._checkboxMouseOutHandler=$.proxy(this._checkboxMouseOut,this);this._checkboxClickHandler=$.proxy(this._checkBoxClicked,this);this._hCheckboxClickHandler=$.proxy(this._headerCheckBoxClicked,this)}},_registerEvents:function(){this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.bind("iggrid_rowsrendering",this._recordsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.bind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.bind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.bind("iggridselectioncellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.bind("iggridselectionrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.bind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.bind("iggridselectionselectioncleared",this._clearSelectionHandler);this.grid.element.bind("iggridgroupbygroupedcolumnschanging",this._groupedColumnsChangingHandler);this.grid.element.bind("iggridupdatingrowadded",this._newRowAddedHandler);this.grid.element.bind("iggridupdatinginternalrowadded",this._newRowAddedHandler);this.grid.element.bind("iggridloadondemandrowsrequested",this._newRowAddedHandler)},_unregisterEvents:function(){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.unbind("iggrid_rowsrendering",this._recordsRenderingHandler);this.grid.element.unbind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.unbind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.unbind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRowsHandler);this.grid.element.unbind("iggridselectioncellselectionchanged",this._cellSelectionChangedHandler);this.grid.element.unbind("iggridselectionrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.unbind("iggridselectioninternalrowselectionchanged",this._rowSelectionChangedHandler);this.grid.element.unbind("iggridselectioncleared",this._clearSelectionHandler);this.grid.element.unbind("iggridgroupbygroupedcolumnschanging",this._groupedColumnsChangingHandler);this.grid.element.unbind("iggridupdatingrowadded",this._newRowAddedHandler);this.grid.element.unbind("iggridupdatinginternalrowadded",this._newRowAddedHandler);this.grid.element.unbind("iggridloadondemandrowsrequested",this._newRowAddedHandler)},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){this._cleanInterface(true);return}var self=this;this.grid=gridInstance;this._v=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true;this._flatRenderColgroup=this.grid._renderColgroup;this._createHandlers();this.grid._headerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraHeaderCellHandler});this.grid._footerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraFooterCellHandler});this._registerEvents();this.grid._renderColgroup=function(){if(self._flatRenderColgroup!==undefined){self._rsRenderColgroup.apply(self.grid,$.merge([self._flatRenderColgroup,self],arguments))}};this._checkForSelection()}});$.extend($.ui.igGridRowSelectors,{version:"14.1.20141.1020"})})(jQuery);(function($){$(document).ready(function(){var wm=$("#__ig_wm__").length>0?$("#__ig_wm__"):$('<div id="__ig_wm__"></div>').appendTo(document.body);wm.css({position:"fixed",bottom:0,right:0,zIndex:1e3}).addClass("ui-igtrialwatermark")})})(jQuery);