/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *	infragistics.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 */
(function(factory){if(typeof define==="function"&&define.amd){define(["./infragistics.ui.grid.framework"],factory)}else{return factory(jQuery)}})(function($){"use strict";var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igGridColumnFixing",$.ui.igWidget,{renderInFeatureChooser:true,localeWidgetName:"ColumnFixing",events:{columnFixing:"columnFixing",columnFixed:"columnFixed",columnUnfixing:"columnUnfixing",columnUnfixed:"columnUnfixed",columnFixingRefused:"columnFixingRefused",columnUnfixingRefused:"columnUnfixingRefused"},css:{fixedContainer:"ui-iggrid-fixedcontainer",headerButtonIconContainer:"ui-iggrid-fixcolumn-headerbuttoncontainer",leftFixedContainer:"ui-iggrid-fixedcontainer-left",rightFixedContainer:"ui-iggrid-fixedcontainer-right",headerButtonIcon:"ui-icon ui-corner-all ui-icon-pin-w",headerButtonIconHover:"",headerButtonUnfixIcon:"ui-icon ui-corner-all ui-icon-pin-s",featureChooserIconClassFixed:"ui-icon ui-iggrid-icon-unfix",featureChooserIconClassUnfixed:"ui-icon ui-iggrid-icon-fix",unfixedTableLeft:"ui-iggrid-unfixed-table-left",unfixedTableRight:"ui-iggrid-unfixed-table-right"},options:{headerFixButtonText:undefined,headerUnfixButtonText:undefined,featureChooserTextFixedColumn:undefined,featureChooserTextUnfixedColumn:undefined,locale:{headerFixButtonText:undefined,headerUnfixButtonText:undefined,featureChooserTextFixedColumn:undefined,featureChooserTextUnfixedColumn:undefined},showFixButtons:true,syncRowHeights:true,scrollDelta:40,fixingDirection:"left",columnSettings:[{columnKey:null,columnIndex:null,allowFixing:true,isFixed:false}],minimalVisibleAreaWidth:30,fixNondataColumns:true,populateDataRowsAttributes:true},scrollContainerCheckValue:2,_createWidget:function(){this._fcData={};this._tds={};this._containers={};this._colgroups={};this._isInitFC=false;this._isFunctionsOverriden=false;$.Widget.prototype._createWidget.apply(this,arguments)},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},_unfixColumnInternal:function(colKey,target,after){var noCancel,res={error:true},grid=this.grid,isGroupHeader=this.isGroupHeader(colKey);noCancel=this._trigger(this.events.columnUnfixing,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid});if(noCancel){res=this.unfixColumn(colKey,target,after);if(res.result===false){this._trigger(this.events.columnUnfixingRefused,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,errorMessage:res.error,owner:grid})}else{this._trigger(this.events.columnUnfixed,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid})}}return res},unfixColumn:function(colIdentifier,target,after){if($.type(arguments[1])==="boolean"){target=arguments[2];after=arguments[3]}var col,res,children,isGroupHeader,colKey,mch,grid=this.grid,cols,aObj,scrollContainer=this._containers.body.unfixedContainer;isGroupHeader=this.isGroupHeader(colIdentifier);res={error:this._getLocaleValue("noneError"),result:true,col:null,isGroupHeader:isGroupHeader};if(!isGroupHeader){col=this._getColById(colIdentifier);res.col=col;if(!col){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=col;colKey=col.key;children=[col];res.id=colKey}else{colKey=colIdentifier;res.id=colKey;mch=grid._getMultiHeaderColumnById(colIdentifier);if(!mch){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=mch;children=mch.children}res.children=children;res=this._couldPerformUnfixing(res,target);if(!res.result){return res}if(!target){cols=grid._isMultiColumnGrid?grid._oldCols:grid.options.columns;$.each(cols,function(i,c){if(c.fixed!==true&&!!!c.hidden){target=c.key||c.identifier;return false}});after=false}this._performDomColumnMove(res,target,after,false);aObj=this._rearrangeColumns(colKey,target,after,false);grid._hasFixedColumns=!!grid._fixedColumns.length||grid.hasFixedDataSkippedColumns();this._refreshDOMOnUnfixing(res);grid._onFixedColumnsChanged({isToFix:false,id:colIdentifier,colWidth:res.colWidth,children:res.children,isGroupHeader:isGroupHeader,start:aObj.from.dIndex,length:aObj.from.children.length,at:aObj.at.dIndex});if(grid._fixedColumns.length===0&&(this._getDataSkippedColumnsLength(true)&&!this.options.fixNondataColumns)){this.unfixNonDataColumns()}if(scrollContainer.data("igScroll")!==undefined){scrollContainer.igScroll("refresh");if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){scrollContainer.igScroll("option","scrollWidth",this.grid._calculateContainerWidth())}scrollContainer.igScroll("option","scrollTop",0);scrollContainer.igScroll("option","scrollLeft",0)}if($(".igscroll-hnative-outer",this.grid.container()).length){if(this.grid.fixedBodyContainer().length){if(this.grid.fixingDirection()==="left"){$(".igscroll-hnative-outer",this.grid.container()).css("left",this.grid.fixedBodyContainer().width())}else if(this.grid.fixingDirection()==="right"){$(".igscroll-hnative-outer",this.grid.container()).css("right",this.grid.fixedBodyContainer().width())}}else{if(this.grid.fixingDirection()==="left"){$(".igscroll-hnative-outer",this.grid.container()).css("left","")}else if(this.grid.fixingDirection()==="right"){$(".igscroll-hnative-outer",this.grid.container()).css("right","")}}}else if($(".igscroll-hcontainer",this.grid.container()).length&&!this.grid._vdisplaycontainer().length){if(this.grid.fixedBodyContainer().length){if(this.grid.fixingDirection("left")){$(".igscroll-hcontainer",this.grid.container()).css("left",this.grid.fixedBodyContainer().width())}else if(this.grid.fixingDirection("right")){$(".igscroll-hcontainer",this.grid.container()).css("right",this.grid.fixedBodyContainer().width())}}else{if(this.grid.fixingDirection("left")){$(".igscroll-hcontainer",this.grid.container()).css("left","")}else if(this.grid.fixingDirection("right")){$(".igscroll-hcontainer",this.grid.container()).css("right","")}}}return res},checkAndSyncHeights:function(){this.syncHeights(true)},syncHeights:function(check,clearRowsHeights){if(!this.grid.hasFixedColumns()){return}if(!this._containers||!this._containers.body){this._populateContainers()}var c=this._containers,hTbl=c.header||c.body,fTbl=c.footer||c.body;this._checkAndSyncHeightsForTables(hTbl.fixedTable,hTbl.unfixedTable,"thead",check,clearRowsHeights);this._checkAndSyncHeightsForTables(c.body.fixedTable,c.body.unfixedTable,"tbody",check,clearRowsHeights);this._checkAndSyncHeightsForTables(fTbl.fixedTable,fTbl.unfixedTable,"tfoot",check,clearRowsHeights)},_checkAndSyncHeightsForTables:function($fTbl,$ufTbl,selector,check,clearRowsHeights){selector=selector||"tbody";var h,fH,ufH,uftblH,$fTrs=$fTbl.children(selector).children("tr"),$ufTrs=$ufTbl.children(selector).children("tr"),$fLastTr=$fTrs.last(),$ufLastTr=$ufTrs.last();uftblH=$ufTbl[0].style.height;$fTbl.height("");$ufTbl.height("");if(clearRowsHeights){this._removeRowsHeights($fTrs,true);this._removeRowsHeights($ufTrs,true)}if(!check||$fLastTr.length>0&&(Math.abs($fTbl.outerHeight()-$ufTbl.outerHeight())>1||Math.abs($fLastTr.igOffset().top-$ufLastTr.igOffset().top)>1)){this.syncRowsHeights($fTrs,$ufTrs);fH=$fTbl.height();ufH=$ufTbl.height();h=ufH;if(fH>ufH){h=fH}$fTbl.height(h);$ufTbl.height(h)}else if(uftblH){$ufTbl[0].style.height=uftblH;$fTbl[0].style.height=uftblH}},_syncTableHeights:function(){$("#"+this.grid.id()+"_fixed").height(this.grid.element.height())},_getKeyByVisibleIndex:function(index,isFixed){var col;isFixed=!!isFixed;index-=this._getDataSkippedColumnsLength(isFixed);col=this.grid._visibleColumns(isFixed)[index];return col?col.key:undefined},changeLocale:function(){var fc=this.grid.element.data("igGridFeatureChooser"),$container=this.grid.container(),self=this;if(fc&&this.renderInFeatureChooser){fc._removeFeature("ColumnFixing")}this._initFC();$container.find("th").find("[data-fixed]").each(function(){self._changeLocaleForElement($(this))})},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){if(value===this.options[key]){return}this._superApply(arguments);if(key==="minimalVisibleAreaWidth"){this.grid._visibleAreaWidth(value)}},_gridSetOption:function(key,value){var w=value,grid=this.grid,fcw;if(!grid.hasFixedColumns()){return}if(key==="width"){if(typeof value==="string"&&value.indexOf("%")>0){grid.container().css("width",value);w=grid.container().outerWidth()}else{w=parseInt(value,10)}fcw=grid.fixedContainer().outerWidth();if(fcw===null){fcw=grid.fixedBodyContainer().outerWidth()}if(w-fcw<parseInt(this.options.minimalVisibleAreaWidth,10)){throw new Error(this._getLocaleValue("setOptionGridWidthException"))}}},_gridWidthChanged:function(){var grid=this.grid;if(!grid.hasFixedColumns()){return}if(this._isVirtualGrid()){this._recalcTableWidths();if(this.options.fixingDirection==="right"){this._adjustVirtWidthOnFixingRight(false)}}},isGroupHeader:function(colKey){if(this.grid._isMultiColumnGrid&&!this.grid.columnByKey(colKey)){return true}return false},_fixColumnInternal:function(colKey,target,after){var noCancel,res={error:true},grid=this.grid,isGroupHeader=this.isGroupHeader(colKey);noCancel=this._trigger(this.events.columnFixing,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid});if(noCancel){res=this.fixColumn(colKey,target,after);if(res.error===this._getLocaleValue("fixingRefusedError")||res.result===false){this._trigger(this.events.columnFixingRefused,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,errorMessage:res.error,owner:grid})}else{this._trigger(this.events.columnFixed,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid})}}return res},_isVirtualGrid:function(){var gridOptions=this.grid.options;return gridOptions.virtualization===true||gridOptions.rowVirtualization===true},_isContinuousVirtualization:function(){return this._isVirtualGrid()&&this.grid.options.virtualizationMode==="continuous"},_getColById:function(colId){if($.type(colId)==="string"){return this.grid.columnByKey(colId)}return this.grid.options.columns[colId]},_updateWidths:function(colWidth){var $fArea,$ufArea,grid=this.grid,v=this._isVirtualGrid(),$fCntnr=this._mainFixedCntnr,w,width=0;if(grid.options.fixedHeaders&&grid.options.showHeader){$fArea=this._containers.header.fixedTable;$ufArea=this._containers.header.unfixedTable;this._updateTblWidths($fArea,$ufArea,colWidth);if(this._isVirtualGrid()){$ufArea.find(">colgroup>col").each(function(ind,col){width+=parseInt(col.style.width,10)||0});width-=colWidth;$ufArea[0].style.width=width+this.grid._scrollbarWidth()+"px"}}$fArea=this._containers.body.fixedTable;$ufArea=grid.element;if(this._isVirtualGrid()&&grid._gridHasWidthInPercent()){$ufArea.width(this.grid.options.width);this._containers.header.unfixedTable.width(this.grid.options.width);this._containers.header.unfixedTable.css("max-width",width+this.grid._scrollbarWidth());$ufArea.css("max-width",width)}this._updateTblWidths($fArea,$ufArea,colWidth);if(grid.options.fixedFooters&&this._containers.footer){$fArea=this._containers.footer.fixedTable;$ufArea=this._containers.footer.unfixedTable;this._updateTblWidths($fArea,$ufArea,colWidth)}if(v){this._updateVirtualDOMWidth(colWidth);return}w=parseFloat($fCntnr[0].style.width||0);$fCntnr[0].style.width=w+colWidth+"px"},_calcTblWidth:function($tbl,delta){var styleWidth=$tbl[0].style.width,w;if($.type(styleWidth)==="string"&&styleWidth.indexOf("%")>-1){return styleWidth}w=parseInt(styleWidth,10)||0;if(w===0){$tbl.find(">colgroup>col").each(function(ind,col){w+=parseInt(col.style.width,10)||0})}return w+delta+"px"},_updateTblWidths:function($fixedTbl,$unfixedTbl,colWidth){var fW,ufW,fTbl=$fixedTbl[0],ufTbl=$unfixedTbl[0];ufW=this._calcTblWidth($unfixedTbl,-colWidth);fW=this._calcTblWidth($fixedTbl,colWidth);fTbl.style.width=fW;ufTbl.style.width=ufW;if(this._isVirtualGrid()){$fixedTbl.closest("div")[0].style.width=fW}},_updateVirtualDOMWidth:function(colWidth){var grid=this.grid,w,$col,$cntnr,widthInPerc=grid._gridHasWidthInPercent(),$displCntnr=grid._vdisplaycontainer(),$virtTbl=grid._virtualcontainer(),$virtColgroup=$virtTbl.children("colgroup");$col=$virtColgroup.children("col[data-fixed-col]");w=parseInt($col.attr("width"),10)||0;$col.attr("width",w+colWidth+"px");if(!widthInPerc){$col=$virtColgroup.children("col:not([data-fixed-col])").first();w=parseInt($col.attr("width"),10)||0;$col.attr("width",w-colWidth+"px");if(grid.options.showHeader){$cntnr=$("#"+grid.id()+"_headers_v");$cntnr.width($cntnr.width()-colWidth)}if(grid.options.showFooter){$cntnr=grid._fixedfooters();$cntnr.width($cntnr.width()-colWidth)}$displCntnr.width($displCntnr.width()-colWidth)}},_recalcTableWidths:function(){var c=this._containers;if(c.header){c.header.unfixedTable.width("")}if(c.footer){c.footer.unfixedTable.width("")}this.grid.element.width("");this._updateWidths(0)},_swapElements:function(area){var swap=area.from;area.from=area.to;area.to=swap;return area},_analyzeFixingObjects:function(colObj,target){var grid=this.grid,tObj,j,movedCol={start:-1,length:colObj.children.length},targetCol={start:-1,length:1},vIndFrom,vIndTo;vIndFrom=this.grid.getVisibleIndexByKey(colObj.children[0].key,true);if($.type(target)==="string"){tObj=grid._analyzeColumnByKey(target)}if(_aNull(target)){vIndTo=-1}else{targetCol.length=tObj.children.length;for(j=0;j<tObj.children.length;++j){if(!tObj.children[j].hidden){vIndTo=grid.getVisibleIndexByKey(tObj.children[j].key,true);break}}}movedCol.start=vIndFrom;targetCol.start=vIndTo;return{movedCol:movedCol,targetCol:targetCol}},_performDomColumnMove:function(col,target,after,isToFix){var grid=this.grid,oCols,aObj,nW,afc=this._analyzeFixingObjects(col,target),movedCol=afc.movedCol,targetCol=afc.targetCol;movedCol.width=col.colWidth;movedCol.id=col.id;if(grid._isMultiColumnGrid){oCols=$.extend(true,[],grid._oldCols);aObj=grid._analyzeColumnMovingObjects(col.id,target,after,isToFix);grid._rearrangeArray(oCols,aObj.from.dMCHIndex,1,aObj.at.dMCHIndex);movedCol.oCols=oCols;if(movedCol.length>1){nW=0;movedCol.length=$.grep(aObj.from.children,function(col){var v=!col.hidden;nW+=v?parseFloat(col.width):0;return v}).length;movedCol.width=nW}}this._performDomColumnMoveByIndexes(movedCol,targetCol,after,isToFix)},_performDomColumnMoveByIndexes:function(movedCol,targetCol,after,isToFix){var grid=this.grid,area={},$fTbl,$ufTbl,w=isToFix?movedCol.width:-movedCol.width;this._updateWidths(w);$fTbl=grid.fixedHeadersTable();$ufTbl=grid.headersTable();area.from=$fTbl;area.to=$ufTbl;if(isToFix){area=this._swapElements(area)}if(grid.options.fixedHeaders===true){grid._moveCols({from:area.from.children("colgroup"),to:area.to.children("colgroup"),ignoreDataSkip:true},movedCol,targetCol,after)}if(grid._isMultiColumnGrid){if(!movedCol.nonData){this._fixUnfixMCHColumn(movedCol.id,{fixedThead:$fTbl.children("thead"),unfixedThead:$ufTbl.children("thead"),isToFix:isToFix,after:after},movedCol.oCols)}else{grid._moveColumnInBodyFooter({trsFrom:area.from.find("thead").children("tr[data-mch-level="+grid._maxLevel+"]"),trsTo:area.to.find("thead").children("tr[data-mch-level="+grid._maxLevel+"]"),ignoreDataSkip:true},movedCol,targetCol,after)}}grid._moveColumnInBodyFooter({trsFrom:area.from.find("thead").children("tr:not([data-mch-level])"),trsTo:area.to.find("thead").children("tr:not([data-mch-level])"),ignoreDataSkip:true},movedCol,targetCol,after);area.from=grid.fixedBodyContainer().children("table");area.to=grid.element;if(isToFix){area=this._swapElements(area)}grid._moveColumnInBodyFooter({trsFrom:area.from.children("tbody").children("tr"),trsTo:area.to.children("tbody").children("tr"),ignoreDataSkip:true},movedCol,targetCol,after);grid._moveCols({from:area.from.children("colgroup"),to:area.to.children("colgroup"),ignoreDataSkip:true},movedCol,targetCol,after);area.from=grid.fixedFootersTable();area.to=grid.footersTable();if(isToFix){area=this._swapElements(area)}if(grid.options.fixedFooters===true){grid._moveCols({from:area.from.children("colgroup"),to:area.to.children("colgroup"),ignoreDataSkip:true},movedCol,targetCol,after)}grid._moveColumnInBodyFooter({trsFrom:area.from.children("tfoot").children("tr"),trsTo:area.to.children("tfoot").children("tr"),ignoreDataSkip:true},movedCol,targetCol,after);this._updateHScrollbarWidth(w)},_getColumnWidth:function(col,$th){var w,grid=this.grid,$tbl,$col,funcGetWidth=function(){$th=$th||this._getTH(col.key);return $th.length===1&&$th.is(":visible")?$th.outerWidth():col.width||0};if(grid._isMultiColumnGrid){return funcGetWidth()}$tbl=col.fixed?grid.fixedBodyContainer().children("table"):this.element;$col=$tbl.find(">colgroup>col").eq(grid.getVisibleIndexByKey(col.key,true));w=$col.length?parseInt($col.width(),10):0;return w||parseInt(col.width,10)||funcGetWidth()},_updateGridWidth:function(){var grid=this.grid;grid._gridContentWidth=grid.element.width();if(!this._isVirtualGrid()){grid._gridInnerWidth=grid.scrollContainer().width();if(grid.options.height){grid._gridInnerWidth+=grid._scrollbarWidth()}}else{grid._gridInnerWidth=grid._vdisplaycontainer().width()+grid._scrollbarWidth()}},_refreshDOMOnUnfixing:function(colObj){var grid=this.grid,fDirRight=this.options.fixingDirection==="right";this._populateContainers();if($.ig.util.isIE10){grid._hscrollbar().width("")}this._updateGridWidth();grid._columnMovingResets();grid._hscrollbarcontent().scrollLeft(0);if(!colObj.nonData){this._changeStyleHeaderButton(colObj.id,false,colObj.isGroupHeader)}if(this._isVirtualGrid()){grid._scrollContainer().scrollTop(0);this._updateHScrollbarWidth();grid._resetVirtualDom();if(this._isContinuousVirtualization()){grid._setScrollContainerScrollTop(0)}if(fDirRight){this._adjustVirtWidthOnFixingRight(false)}}else{this._containers.body.unfixedContainer.scrollTop(0)}if(grid._fixedColumns.length===0&&(!this._getDataSkippedColumnsLength(true)||fDirRight)){this._removeFixedContainer();if(fDirRight&&!grid.options.fixedHeaders){grid._hscrollbarcontent().css("overflow-y","scroll")}}else if(this.options.syncRowHeights){this.checkAndSyncHeights()}if(fDirRight){this._removeCellPaddingForAllColumns(false)}if(grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer()}grid._updateVerticalScrollbarCellPadding()},_refreshDOMOnFixing:function(id,isInit){var grid=this.grid,fDir=this.options.fixingDirection,v=this._isVirtualGrid();this._updateGridWidth();if(isInit){if(this._containers&&this._containers.body){if(fDir==="left"){this._containers.body.unfixedTable.addClass(this.css.unfixedTableLeft)}else{this._containers.body.unfixedTable.addClass(this.css.unfixedTableRight);this._adjustWidthOnFixingRight()}}}grid._columnMovingResets();if(!_aNull(id)){this._changeStyleHeaderButton(id,true)}this._containers.body.unfixedContainer.scrollTop(0);if(v){grid._scrollContainer().scrollTop(0);this._updateHScrollbarWidth();grid._resetVirtualDom();if(isInit){this._attachVirtualizationEvents()}if(this._isContinuousVirtualization()){this._containers.body.fixedContainer.scrollTop(this._containers.body.unfixedContainer.scrollTop())}if(!grid._outerHScrollbar){grid._hscrollbarcontent().css("overflow-y","hidden")}if(fDir==="right"){this._adjustVirtWidthOnFixingRight(true)}}if(grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer();if(isInit&&v){grid._updateHScrollbarVisibility()}}this._checkAndRenderHScrlbarCntnr();grid._hscrollbarcontent().scrollLeft(0);if(grid._initialized){grid._updateVerticalScrollbarCellPadding()}if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_setMinWidthForGridContainer:function(w){var $fc=this._mainFixedCntnr||this._containers.body.fixedContainer,$gc=this.grid.container();if(this.grid.hasFixedColumns()&&$fc.length){w=w||parseFloat($fc[0].style.width)||$fc.outerWidth();w+=parseFloat(this.options.minimalVisibleAreaWidth);$gc.css("min-width",w+"px")}else{$gc.css("min-width","")}},_couldPerformUnfixing:function(colObj,target){var grid=this.grid,mchLevel,$th,tCol;if(!!colObj.col.fixed===false){colObj.result=false;colObj.error=this._getLocaleValue("alreadyUnfixedError");return colObj}if(colObj.col.hidden){colObj.result=false;colObj.error=this._getLocaleValue("alreadyHiddenError");return colObj}if(!_aNull(target)){tCol=grid.columnByKey(target);if(!tCol){colObj.result=false;colObj.error=this._getLocaleValue("targetNotFoundError").replace("{key}",target);return colObj}if(tCol.fixed){colObj.result=false;colObj.error=this._getLocaleValue("unfixingRefusedError");return colObj}}$th=this._getTH(colObj.id);if(grid._isMultiColumnGrid){mchLevel=$th.closest("tr").attr("data-mch-level");if(mchLevel&&parseInt(mchLevel,10)!==grid._maxLevel){colObj.result=false;colObj.error=this._getLocaleValue("ActionNotAllowedForChildHeaderColumnError");return colObj}}colObj.colWidth=this._getColumnWidth(colObj.col,$th);if(!this.checkUnfixingAllowed(colObj.children)){colObj.result=false;colObj.error=this._getLocaleValue("unfixingRefusedError");return colObj}return colObj},_couldPerformFixing:function(colObj,target){var grid=this.grid,gridWidth,mchLevel,widthFixedCntr,$th,colWidth,tCol,vScrlBarW;if(colObj.col.fixed){colObj.result=false;colObj.error=this._getLocaleValue("alreadyFixedError");return colObj}if(colObj.col.hidden||!grid._initialized&&$.inArray(colObj.col,grid._initialHiddenColumns)>-1){colObj.result=false;colObj.error=this._getLocaleValue("alreadyHiddenError");return colObj}if(!_aNull(target)){tCol=grid.columnByKey(target)||this.grid._getMultiHeaderColumnById(target);if(!tCol){colObj.result=false;colObj.error=this._getLocaleValue("targetNotFoundError").replace("{key}",target);return colObj}if(!tCol.fixed){colObj.result=false;colObj.error=this._getLocaleValue("fixingRefusedError");return colObj}}gridWidth=grid.container().outerWidth();$th=this._getTH(colObj.id);if(grid._isMultiColumnGrid){mchLevel=$th.closest("tr").attr("data-mch-level");if(mchLevel&&parseInt(mchLevel,10)!==grid._maxLevel){colObj.result=false;colObj.error=this._getLocaleValue("ActionNotAllowedForChildHeaderColumnError");return colObj}}if(!this.checkFixingAllowed(colObj.children,colObj.isGroupHeader)){colObj.result=false;colObj.error=this._getLocaleValue("fixingRefusedError");return colObj}if(grid.hasFixedColumns()){widthFixedCntr=this._containers.body.fixedContainer.outerWidth()}if(isNaN(widthFixedCntr)){widthFixedCntr=0}colWidth=this._getColumnWidth(colObj.col,$th);colObj.colWidth=colWidth;vScrlBarW=this._isVirtualGrid()||grid._initialized&&grid.hasVerticalScrollbar()||grid.options.height?grid._scrollbarWidth():0;if(colWidth+widthFixedCntr+vScrlBarW>=gridWidth-parseInt(this.options.minimalVisibleAreaWidth,10)){colObj.result=false;colObj.error=this._getLocaleValue("fixingRefusedMinVisibleAreaWidthError");return colObj}return colObj},checkFixingAllowed:function(columns){var i,visibleColumnsCount=0;for(i=0;i<columns.length;i++){if(!columns[i].hidden){visibleColumnsCount++}}if(this.grid._visibleColumns(false).length-visibleColumnsCount<1){return false}return this._isFixingUnfixingAllowed(columns,true)},checkUnfixingAllowed:function(columns){return this._isFixingUnfixingAllowed(columns,false)},_isFixingUnfixingAllowed:function(columns,isToFix){var i,columnsLength=columns.length,j,col,columnsInArea=[],oCols=this.grid.options.columns,oColsLength=oCols.length;for(i=0;i<oColsLength;i++){if(!isToFix&&oCols[i].fixed||isToFix&&!oCols[i].fixed){for(j=0;j<columnsLength;j++){col=columns[j];if(col.key===oCols[i].key){break}}if(j===columnsLength){columnsInArea.push(oCols[i])}}}if(columnsInArea.length===0){return true}for(i=0;i<columnsInArea.length;i++){if(!columnsInArea[i].hidden){return true}}return false},_rearrangeColumns:function(colKey,targetKey,after,isToFix){var grid=this.grid,targetColInfo,tInd,aObj=grid._analyzeColumnMovingObjects(colKey,targetKey,after,isToFix),children;grid._rearrangeArray(grid.options.columns,aObj.from.dIndex,aObj.from.children.length,aObj.at.dIndex);if(aObj.at.dMCHIndex>-1){grid._rearrangeArray(grid._oldCols,aObj.from.dMCHIndex,1,aObj.at.dMCHIndex)}this._setFixingStateByCol(aObj.from.colMCHObj||aObj.from.colObj,isToFix);children=aObj.from.children.filter(function(col){return col.hidden===false});if(isToFix){targetColInfo=!_aNull(targetKey)?grid._getColumnInfo(targetKey,grid._fixedColumns):null;tInd=!_aNull(targetColInfo)?targetColInfo.index:grid._fixedColumns.length;grid._fixedColumns.insertRange(tInd,children)}else{grid._fixedColumns.splice(grid._getColumnInfo(children[0].key,grid._fixedColumns).index,children.length)}grid._columnMovingResets();return aObj},fixColumn:function(colIdentifier,target,after){if($.type(arguments[1])==="boolean"){target=arguments[2];after=arguments[3]}var col,res,children,isGroupHeader,colKey,aObj,grid=this.grid,mch,fixedCols=grid._fixedColumns,isInit=fixedCols.length===0;isGroupHeader=this.isGroupHeader(colIdentifier);res={error:this._getLocaleValue("noneError"),result:true,col:null,isInit:isInit,isGroupHeader:isGroupHeader};if(!isGroupHeader){col=this._getColById(colIdentifier);res.col=col;if(!col){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=col;colKey=col.key;children=[col];res.id=colKey;delete col.oWidth}else{colKey=colIdentifier;res.id=colKey;mch=this.grid._getMultiHeaderColumnById(colIdentifier);if(!mch){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=mch;children=mch.children}res.children=children;res=this._couldPerformFixing(res,target);if(!res.result){return res}if(res.colWidth!==parseFloat(res.col.width)){res.col.width=res.colWidth}after=$.type(after)==="boolean"?after:true;if(isInit&&!this.element.data("fixingApplied")){this._renderMainFixedContainer();this.fixNonDataColumns()}if(!this._containers||!this._containers.body){this._populateContainers()}this._performDomColumnMove(res,target,after,true);aObj=this._rearrangeColumns(colKey,target,after,true);grid._hasFixedColumns=true;this._refreshDOMOnFixing(res.id,res.isInit);grid._onFixedColumnsChanged({isToFix:true,id:colIdentifier,colWidth:res.colWidth,children:res.children,isGroupHeader:isGroupHeader,isInit:isInit,start:aObj.from.dIndex,length:aObj.from.children.length,at:aObj.at.dIndex});if(grid.element.igScroll!==undefined){this._updateIgScroll(true)}return res},_updateIgScroll:function(applySettings){var grid=this.grid,scrollContainer=this._containers.body.unfixedContainer,fixedContainer=this._containers.body.fixedContainer,scrollSettings=grid.options.scrollSettings;scrollSettings.scrollTop=0;scrollSettings.scrollLeft=0;if(scrollContainer.data("igScroll")){scrollContainer.igScroll("refresh");if(this._containers.body.fixedTable.length>0){scrollContainer.igScroll("option","syncedElemsV",[this._containers.body.fixedTable])}if(grid.options.virtualization===true||grid.options.rowVirtualization===true){scrollContainer.igScroll("option","scrollWidth",grid._calculateContainerWidth());scrollContainer.on("iggridrendered",function(){if(applySettings){scrollContainer.igScroll("option",scrollSettings)}grid._enableVirtualTouchScrollbars(scrollContainer)})}else{if(applySettings){scrollContainer.igScroll("option",scrollSettings)}if($(".igscroll-hnative-outer",grid.container()).length&&grid.fixingDirection()==="left"){$(".igscroll-hnative-outer",grid.container()).css("left",fixedContainer.width())}else if($(".igscroll-hcontainer",grid.container()).length&&grid.fixingDirection()==="left"){$(".igscroll-hcontainer",grid.container()).css("left",fixedContainer.width())}if($(".igscroll-hnative-outer",grid.container()).length&&grid.fixingDirection()==="right"){$(".igscroll-hnative-outer",grid.container()).css("right",fixedContainer.width())}else if($(".igscroll-hcontainer",grid.container()).length&&grid.fixingDirection()==="right"){$(".igscroll-hcontainer",grid.container()).css("right",fixedContainer.width())}}}else{scrollContainer.bind("igscrollrendered",$.proxy(this._onIgScrollCreated,this))}if(fixedContainer.data("igScroll")){fixedContainer.igScroll("refresh");if(grid.options.virtualization===true||grid.options.rowVirtualization===true){fixedContainer.igScroll("option","scrollOnlyVBar",true);fixedContainer.igScroll("option","scrollbarV",grid._scrollContainer());fixedContainer.data("igScroll")._content=grid._scrollContainer().children(":first-child")}else{fixedContainer.igScroll("option","syncedElemsV",[this._containers.body.unfixedTable])}if(applySettings){fixedContainer.igScroll("option",scrollSettings)}}else{fixedContainer.bind("igscrollrendered",$.proxy(this._onIgScrollCreated,this))}},_onIgScrollCreated:function(){this._updateIgScroll()},_attachVirtualizationEvents:function(){var grid=this.grid;grid.fixedBodyContainer().bind({mouseenter:function(){grid._isMouseOverVirtualTable=true},mouseleave:function(){grid._isMouseOverVirtualTable=false}})},fixNonDataColumns:function(){var grid=this.grid,cols=this._getDataSkippedCols(),w=this._getDataSkippedWidth(false,cols),len=cols.length;if(this.options.fixingDirection==="left"&&len){if(!$("#"+grid.id()+"_mainFixedContainer").length&&!this.element.data("fixingApplied")){this._renderMainFixedContainer()}grid._hasFixedDataSkippedColumns=true;grid._hasFixedColumns=!!grid._fixedColumns.length||grid.hasFixedDataSkippedColumns();this._performDomColumnMoveByIndexes({start:0,length:len,width:w,nonData:true},{start:-1,length:0},false,true);this._refreshDOMOnFixing(null,true);if(this.options.syncRowHeights){this.checkAndSyncHeights()}if(this._isVirtualGrid()){this.grid._hscrollbarcontent().css("overflow-y","hidden")}this._checkAndRenderHScrlbarCntnr();grid._hasFixedColumns=true;this.grid._onFixedColumnsChanged({isToFix:true,nonData:true,isInit:true,length:len})}},fixDataSkippedColumns:function(){this.fixNonDataColumns()},unfixNonDataColumns:function(){var w,cols=this._getDataSkippedCols(true),len=cols.length;if(this.options.fixingDirection==="left"&&len){w=this._getDataSkippedWidth(true,cols);this._performDomColumnMoveByIndexes({start:0,length:len,width:w,nonData:true},{start:0,length:0},false,false);this.grid._hasFixedColumns=!!this.grid._fixedColumns.length;this.grid._hasFixedDataSkippedColumns=false;this._refreshDOMOnUnfixing({nonData:true,width:w});this.grid._onFixedColumnsChanged({isToFix:false,nonData:true,length:len})}},unfixDataSkippedColumns:function(){this.unfixNonDataColumns()},_getDataSkippedWidth:function(isFixed,cols){var w=0;cols=cols||this._getDataSkippedCols(isFixed);cols.each(function(i,c){w+=parseFloat(c.style.width)});return w},_getDataSkippedCols:function(isFixed){if(!this._containers||!this._containers.body){this._populateContainers()}var $table=isFixed?this._containers.body.fixedTable:this._containers.body.unfixedTable;return $table.find("colgroup col[data-skip]")},_getDataSkippedColumnsLength:function(isFixed){return this._getDataSkippedCols(isFixed).length},unfixAllColumns:function(){if(!this.grid.hasFixedColumns()){return}var i,self=this,colsToUnfix=[];if(this.grid._isMultiColumnGrid){this.grid.fixedHeadersTable().children("thead").children("tr[data-mch-level]:nth-child(1)").children("th:not([data-skip])").each(function(index,th){var $th=$(th),id;id=$th.attr("data-mch-id");id=id||$th.attr("id").replace(self.grid.id()+"_","");colsToUnfix.push(id)})}else{colsToUnfix=$.map(this.grid._fixedColumns,function(c){return c.key})}if(colsToUnfix.length>0){for(i=colsToUnfix.length-1;i>=0;i--){this.unfixColumn(colsToUnfix[i])}}},_removeFixedContainer:function(){this.element.data("fixingApplied",false);var grid=this.grid,scrollContainer,v=this._isVirtualGrid();if(v){this._removeFixedContainerVirtualization()}if(!this._containers){this._populateContainers()}scrollContainer=this._containers.body.unfixedContainer;scrollContainer.unbind(".columnFixing");this.element.unbind(".columnFixing");if(this._containers&&this._containers.body){this._containers.body.unfixedTable.removeClass(this.css.unfixedTableLeft).removeClass(this.css.unfixedTableRight);if(!v){this._containers.body.unfixedTable.css("height","")}}if(!_aNull(this._DOMMouseScroll)){scrollContainer.unbind({DOMMouseScroll:this._DOMMouseScroll});this._DOMMouseScroll=null}grid.fixedContainer().remove();if(this.options.fixingDirection==="right"&&!v){scrollContainer.css({"overflow-y":"auto"});this.grid._hscrollbarcontent().css({
"overflow-y":"scroll"})}if(!grid._outerHScrollbar){grid._hscrollbar().css({width:"100%",left:0})}if(grid.options.width===null&&grid.container()[0].style.width===""){grid.container().css("width","")}if(grid.options.enableHoverStyles){this._dettachHoverEvents()}$("#"+grid.id()+"_floatCompensate").remove()},_removeFixedContainerVirtualization:function(){var $virtCntnr=this.grid._virtualcontainer();$virtCntnr.children("colgroup").children("col[data-fixed-col]").remove();$virtCntnr.children("tbody").children("tr").children("td[data-fixed-container]").remove()},_getRowsHtml:function($unfixedArea,type){var html="",attrs,i,j,len,tr,a,h,av,an,synch=this.options.syncRowHeights,trs=$unfixedArea.children("tr");this._heights=this._heights||{};this._heights[type]=[];len=trs.length;for(i=0;i<len;i++){tr=trs[i];attrs=tr.attributes;html+="<tr";for(j=0;j<attrs.length;j++){a=attrs[j];av=a.value;an=a.name;if(an==="id"||an==="ID"){av+="_fixed"}html+=" "+an+'="'+av+'"'}if(synch){h=$.ig.util.isIE?tr.getBoundingClientRect().height:tr.offsetHeight;this._heights[type].push({h:h,tr:tr});html+=' height="'+h+'px"'}html+="></tr>"}return html},_renderContainerInVirtGrid:function($tr,$table,type){var $cntnr,$td=$('<td data-fixed-container="'+type+'" style="border-width: 0px;"></td>'),cssClass=this.options.fixingDirection==="left"?this.css.leftFixedContainer:this.css.rightFixedContainer;if(this.options.fixingDirection==="left"){$td.prependTo($tr)}else{$tr.children("td:first").removeAttr("colspan");if(type==="body"){$td.insertBefore($tr.children("td:last"))}else{$td.attr("colspan",2);$td.appendTo($tr)}}$cntnr=this._renderContainer($td,$table,type);$cntnr.addClass(cssClass);this._containers[type].fixedContainer.width(0);this._containers[type].fixedTable.width(0);return $cntnr},_renderContainer:function($mainFixedCntr,$table,type){var fixedContainerId,$fixedContainer,$fixedTable,html;switch(type){case"header":fixedContainerId=this.grid.id()+"_fixedHeaderContainer";html="<thead></thead>";break;case"footer":fixedContainerId=this.grid.id()+"_fixedFooterContainer";html='<tfoot role="rowgroup"></tfoot>';break;default:fixedContainerId=this.grid.id()+"_fixedBodyContainer";html='<tbody class="'+this.grid.css.recordClass+'">'+this._getRowsHtml($table.children("tbody"),type)+"</tbody>";break}$fixedContainer=$('<div id="'+fixedContainerId+'" data-fixed-container="true"></div>').appendTo($mainFixedCntr);if(type==="body"){$fixedContainer.attr("data-scroll","true")}$fixedTable=$('<table id="'+$table.attr("id")+'_fixed"'+' class="'+$table.attr("class")+'" '+' style="table-layout:fixed;" '+" border=0 cellpadding=0 cellspacing=0><colgroup />"+html+"</table>");$fixedTable.appendTo($fixedContainer);this._containers[type]=this._containers[type]||{};this._containers[type].fixedContainer=$fixedContainer;this._containers[type].fixedTable=$fixedTable;this._containers[type].unfixedContainer=$table.closest("div");this._containers[type].unfixedTable=$table;$fixedContainer.css({overflow:"hidden",position:"relative"});if(type==="header"){this._containers.header.fixedContainer.addClass(this._containers.header.unfixedContainer.attr("class"))}return $fixedContainer},_scrollTopFixedContainer:function(direction){var fC=this._scrollContainers.fCntnr,ufC=this._scrollContainers.ufCntnr,scrollTop=fC.scrollTop();direction=direction||0;scrollTop-=direction*this.options.scrollDelta;scrollTop=scrollTop<0?0:scrollTop;fC.scrollTop(scrollTop);ufC.scrollTop(scrollTop)},_syncScrollTopContainers:function($cntnr,$cntnrToScroll){$cntnrToScroll.scrollTop($cntnr.scrollTop())},_bindEvents:function(){var grid=this.grid,self=this,fc=this._scrollContainers.fCntnr,ufc=this._scrollContainers.ufCntnr;if(grid.options.enableHoverStyles){this._attachHoverEvents()}if(this._isContinuousVirtualization()){ufc.bind({scroll:function(){self._syncScrollTopContainers($(this),fc)}})}fc.delegate("tr, td",{focus:function(){if($.ig.util.isIE){setTimeout(function(){self._syncScrollTopContainers(fc,ufc)},0)}else{self._syncScrollTopContainers(fc,ufc)}}});if(grid.element.igScroll!==undefined){if((grid.options.virtualization||grid.options.rowVirtualization)&&!ufc.data("igScroll")){ufc.igScroll({modifyDOM:false,scrollbarType:"none"});ufc.data("igScroll")._bKeyboardNavigation=false;ufc.data("igScroll")._bMixedEnvironment=true}fc.igScroll({modifyDOM:false,scrollbarType:"none"});fc.data("igScroll")._bKeyboardNavigation=false;if(grid.options.virtualization||grid.options.rowVirtualization){fc.data("igScroll")._bMixedEnvironment=true}fc.css("-ms-touch-action","none");ufc.on("iggriddatarendered",$.proxy(this._onIgScrollCreated,this))}if(this._isVirtualGrid()){return}this._onMouseWheelHandler=function(event){var evt,direction,w,d,st;evt=event.originalEvent;w=evt.wheelDelta;d=evt.detail;if(d){if(w){direction=w/d/40*d>0?1:-1}else{direction=-d/3}}else{direction=w/120}st=fc.scrollTop();self._scrollTopFixedContainer(direction);if(grid.options.height===null||st===fc.scrollTop()){return true}return false};this._DOMMouseScroll=function(event){var dir=-1,delta;delta=-event.originalEvent.detail/3;if(delta>0){dir=1}self._scrollTopFixedContainer(dir);if(grid.options.height===null){return true}event.preventDefault()};if(this.options.fixingDirection==="right"){this._bindEventsToContainers(fc,ufc);this.element.bind({"mousewheel.columnFixing":this._onMouseWheelHandler,"DOMMouseScroll.columnFixing":this._DOMMouseScroll});ufc.bind({"scroll.columnFixing":function(){self._syncScrollTopContainers($(this),fc)}})}else{this._bindEventsToContainers(ufc,fc)}},_bindEventsToContainers:function($scrollable,$hiddenScroll){var self=this,selection=this.grid.element.data("igGridSelection");$scrollable.bind({"scroll.columnFixing":function(){self._syncScrollTopContainers($(this),$hiddenScroll)}});if($.ig.util.isIE){$scrollable.bind({"mousewheel.columnFixing":function(e){self._onMouseWheelHandler(e)}})}$hiddenScroll.bind({"mousewheel.columnFixing":this._onMouseWheelHandler,"DOMMouseScroll.columnFixing":this._DOMMouseScroll,"keydown.columnFixing":function(e){if(!selection){if(e.keyCode===$.ui.keyCode.UP){self._scrollTopFixedContainer(1)}else if(e.keyCode===$.ui.keyCode.DOWN){self._scrollTopFixedContainer(-1)}}}})},_renderMainFixedContainerInVirtGrid:function(){this._populateContainers();var grid=this.grid,$col,$pScrlbar,html,$colgroup,$hscrlbar=grid._vhorizontalcontainer(),$td,$vContainer=grid._virtualcontainer(),fixedBodyContainer,scrollContainer,scrollContainerHeight;$colgroup=$vContainer.children("colgroup:first");scrollContainer=this._containers.body.unfixedContainer;$col=$("<col />").attr("data-fixed-col",this.options.fixingDirection);if(this.options.fixingDirection==="left"){$col.prependTo($colgroup)}else{$col.insertBefore($colgroup.children("col:last"))}fixedBodyContainer=this._renderContainerInVirtGrid(this._containers.body.unfixedContainer.closest("tr"),this._containers.body.unfixedTable,"body");fixedBodyContainer.addClass(grid.css.gridVirtualScrollDivClass).addClass(grid.css.gridScrollDivClass);if($.ig.util.isIE){fixedBodyContainer.children("table").height(scrollContainer.children("table").height())}scrollContainerHeight=scrollContainer.height();fixedBodyContainer.height(scrollContainerHeight);fixedBodyContainer.bind(grid._mouseClickEventHandlers);if(grid.options.showHeader){this._renderContainerInVirtGrid(this._containers.header.unfixedContainer.closest("tr"),this._containers.header.unfixedTable,"header");html=this._getRowsHtml(this._containers.header.unfixedTable.children("thead"),"header");this._containers.header.fixedTable.children("thead").html(html)}if(grid.options.showFooter&&this._containers.footer){this._renderContainerInVirtGrid(this._containers.footer.unfixedContainer.closest("tr"),this._containers.footer.unfixedTable,"footer");if(grid.options.fixedFooters){this._containers.footer.fixedContainer.bind(grid._mouseClickEventHandlers)}html=this._getRowsHtml(grid.footersTable().children("tfoot"),"footer");grid.fixedFootersTable().children("tfoot").html(html)}grid._fixedTable=fixedBodyContainer.children("table");if(!$hscrlbar.length){$hscrlbar=grid._hscrollbar()}$pScrlbar=$hscrlbar.parent();if($pScrlbar.is("td")){$td=$('<td data-fixed-container="scrollbar"></td>');if(this.options.fixingDirection==="left"){$td.insertBefore($hscrlbar.closest("td"))}else{$td.attr("colspan",2).insertAfter($hscrlbar.closest("td").removeAttr("colspan"))}}this._scrollContainers={fCntnr:fixedBodyContainer,ufCntnr:scrollContainer};this._bindEvents()},_renderMainFixedContainer:function(){this.element.data("fixingApplied",true);if(this._isVirtualGrid()){return this._renderMainFixedContainerInVirtGrid()}var grid=this.grid,gridId=grid.id(),html,fDir=this.options.fixingDirection,scrCntnrTbl,fixedBodyTable,fixedHeaderContainer,fixedFooterContainer,scrollContainer,$mainFixedContainer,fixedBodyContainer,mainFixedContainerId=grid.id()+"_mainFixedContainer",scrollContainerHeight;$mainFixedContainer=$('<div id="'+mainFixedContainerId+'" data-fixed-container="true"></div>');this._mainFixedCntnr=$mainFixedContainer;$mainFixedContainer.css({width:"0px",overflow:"hidden",position:"relative"});scrollContainer=grid.scrollContainer();if(scrollContainer.length){scrCntnrTbl=scrollContainer.children("table")}else{scrollContainer=grid.element;scrCntnrTbl=grid.element}$mainFixedContainer.addClass(this.css.fixedContainer);$mainFixedContainer.insertBefore(grid.options.fixedHeaders&&grid.options.showHeader?grid.headersTable().closest("div"):scrollContainer);if(fDir==="left"){$mainFixedContainer.css({"float":"left",left:0});$mainFixedContainer.addClass(this.css.leftFixedContainer)}else{$mainFixedContainer.css({"float":"right",right:0});$mainFixedContainer.addClass(this.css.rightFixedContainer)}$mainFixedContainer.attr("data-fixing-direction",fDir);$mainFixedContainer.bind(this.grid._mouseClickEventHandlers);fixedBodyContainer=this._renderContainer($mainFixedContainer,scrCntnrTbl,"body");fixedBodyContainer.attr("data-fixing-direction",fDir);if(grid.options.height!==null&&$.ig.util.isIE){fixedBodyContainer.find("table").height(scrCntnrTbl.height())}if(grid.options.height!==null){scrollContainerHeight=scrollContainer.height();if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}}fixedBodyContainer.height(scrollContainerHeight);fixedBodyTable=fixedBodyContainer.find("table");if(grid.options.showHeader){if(grid.options.fixedHeaders&&grid.options.height!==null){fixedHeaderContainer=this._renderContainer($mainFixedContainer,grid.headersTable(),"header");fixedHeaderContainer.prependTo($mainFixedContainer)}else{if(grid.element.find("thead").next().is("tbody")){$("<thead />").insertBefore(fixedBodyContainer.find("tbody"))}else{if(grid.element.find("thead").prev().is("colgroup")){$("<thead />").insertAfter(fixedBodyContainer.find("colgroup"))}else{$("<thead />").insertAfter(fixedBodyContainer.find("tbody"))}}}}if(grid.options.showFooter){if(grid.options.fixedFooters&&grid.options.height!==null){fixedFooterContainer=this._renderContainer($mainFixedContainer,grid.footersTable(),"footer");this._containers.footer.fixedTable.css("whiteSpace",this._containers.footer.unfixedTable.css("whiteSpace"));fixedFooterContainer.appendTo($mainFixedContainer)}else{$('<tfoot role="rowgroup" />').insertAfter(fixedBodyContainer.find("tbody"))}}html=this._getRowsHtml(grid.headersTable().children("thead"),"header");grid.fixedHeadersTable().children("thead").html(html);html=this._getRowsHtml(grid.footersTable().children("tfoot"),"footer");grid.fixedFootersTable().children("tfoot").html(html);if(this.options.syncRowHeights){this._setRowHeights("header");this._setRowHeights("body");this._setRowHeights("footer")}grid._fixedTable=fixedBodyTable;if(fDir==="right"){fixedBodyContainer.css({"overflow-y":"auto"});scrollContainer.css({"overflow-y":"hidden"});this.grid._hscrollbarcontent().css({overflow:"","overflow-y":"hidden"})}this._scrollContainers={fCntnr:fixedBodyContainer,ufCntnr:scrollContainer};this._bindEvents();$('<div style="clear:both" id="'+gridId+'_floatCompensate"></div>').insertAfter(grid.container())},_setRowHeights:function(type){var i,heights=this._heights[type],heightsLength=heights.length;for(i=0;i<heightsLength;i++){heights[i].tr.style.height=heights[i].h+"px"}},_syncRowStyles:function(){var i,fRow,ufRow,container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable,fixedRows=$fixedTable.children("tbody").children("tr"),unfixedRows=$unfixedTable.children("tbody").children("tr"),rLen=fixedRows.length;for(i=0;i<rLen;i++){fRow=fixedRows[i];ufRow=unfixedRows[i];fRow.setAttribute("style",ufRow.getAttribute("style"));fRow.setAttribute("class",ufRow.getAttribute("class"))}},_populateContainers:function(){var gridId=this.grid.id(),grid=this.grid,self=this,virtualization=this._isVirtualGrid(),$unfixedHeaders=this.grid.container().find("#"+gridId+"_headers"),$unfixedFooters=this.grid.container().find("#"+gridId+"_footer_container"),$fixedBodyContainer=this.grid.container().find("#"+gridId+"_fixedBodyContainer"),functionPopulateContainers,scrollContainer;if(virtualization){scrollContainer=this.grid._vdisplaycontainer()}else{scrollContainer=this.grid.scrollContainer()}if(scrollContainer.length===0){scrollContainer=this.grid.element}this._containers={};functionPopulateContainers=function($unfixedContainer,$fixedContainer,type){var $unfixedTable=$unfixedContainer.find("table"),$fixedTable=grid.container().find("#"+$unfixedTable.attr("id")+"_fixed");if($unfixedTable.length===0){$unfixedTable=$unfixedContainer;$fixedTable=grid.container().find("#"+$unfixedTable.attr("id")+"_fixed")}self._containers[type]={fixedContainer:$fixedContainer,unfixedContainer:$unfixedContainer,fixedTable:$fixedTable,unfixedTable:$unfixedTable}};if($unfixedHeaders.length>0){functionPopulateContainers($unfixedHeaders.parent("div"),grid.fixedHeaderContainer(),"header")}functionPopulateContainers(scrollContainer,$fixedBodyContainer,"body");if($unfixedFooters.length>0&&$unfixedFooters[0].nodeName!=="TFOOT"){functionPopulateContainers($unfixedFooters,grid.fixedFooterContainer(),"footer")}},_fixUnfixMCHColumn:function(colId,fixingParams,oCols){var i,grid=this.grid,col,fixedThead=fixingParams.fixedThead,unfixedThead=fixingParams.unfixedThead,isToFix=fixingParams.isToFix,after=fixingParams.after,area=isToFix?fixedThead:unfixedThead,mchInstance=grid.element.data("igGridMultiColumnHeaders");oCols=oCols||grid._oldCols;if(!mchInstance){return}for(i=0;i<oCols.length;i++){if(oCols[i].identifier===colId||oCols[i].key===colId){col=oCols[i];break}}if(i===oCols.length){return}mchInstance._rows={};mchInstance._analyzeRowspanRows(oCols,0);this._fixUnfixMCHColumnRecursive([col],mchInstance._rows,area,isToFix,after)},_fixUnfixMCHColumnRecursive:function(cols,rows,area,isToFix,after){var i,grid=this.grid,$th,id,domLevel,cells,$ths=$(),ind,tCell,col,$targetTh,$tr;for(i=0;i<cols.length;i++){col=cols[i];if(col.level===0){id=!i?col.key:id;$th=grid.container().find("#"+this.grid.id()+"_"+col.key)}else{id=!i?col.identifier:id;$th=this._getTH(col.identifier)}if(_aNull(domLevel)){domLevel=parseInt($th.closest("tr").attr("data-mch-level"),10)}$th.detach();$ths=$ths.add($th)}cells=rows[domLevel];if(cells){$tr=area.find("tr[data-mch-level="+domLevel+"]");if(!$tr.find(">th:not([data-skip])").length||!cells.length){$ths.appendTo($tr)}else{for(i=0;i<cells.length;i++){if(cells[i].identifier===id||cells[i].key===id){ind=i;if(isToFix){tCell=i>0?cells[i-1]:null}else{for(i+=cols.length;i<cells.length;i++){if(!cells[i].fixed){tCell=cells[i];break}}}for(i=ind;i<ind+cols.length;i++){cells[i].fixed=isToFix}break}}if(tCell){$targetTh=this._getTH(_aNull(tCell.key)?tCell.identifier:tCell.key);if(after){$ths.insertAfter($targetTh)}else{$ths.insertBefore($targetTh)}}else{if(after){$ths.appendTo($tr)}else{$ths.prependTo($tr)}}}}for(i=0;i<cols.length;i++){if(!cols[i].group){continue}after=isToFix;this._fixUnfixMCHColumnRecursive(cols[i].group,rows,area,isToFix,after);cols[i].fixed=isToFix}},_dettachHoverEvents:function(){this._populateContainers();var container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable;$fixedTable.undelegate("tbody",".hoverColumnFixing");$unfixedTable.undelegate("tbody",".hoverColumnFixing")},_attachHoverEvents:function(){this._populateContainers();var container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable;this._mouseOverHandler=$.proxy(this._mouseOver,this);this._mouseLeaveHandler=$.proxy(this._mouseLeave,this);$fixedTable.delegate("tbody",{"mousemove.hoverColumnFixing":this._mouseOverHandler,"mouseleave.hoverColumnFixing":this._mouseLeaveHandler});$unfixedTable.delegate("tbody",{"mousemove.hoverColumnFixing":this._mouseOverHandler,"mouseleave.hoverColumnFixing":this._mouseLeaveHandler})},_mouseOver:function(event){var css="ui-state-hover",grid=this.grid,$tr=$(event.target).closest("tr");if(grid._isFixedElement($tr)){grid._mousemoveTr(grid.element.find("tbody tr:nth-child("+($tr.index()+1)+")")[0],event)}if(this._hoverTr){this._hoverTr.find("td,th").removeClass(css)}this._hoverTr=grid.fixedTable().find("tbody").children("tr:nth-child("+($tr.index()+1)+")");this._hoverTr.children("td,th").addClass(css)},_mouseLeave:function(event){var css="ui-state-hover",$tr=$(event.target).closest("tr"),grid=this.grid;if(grid._isFixedElement($tr)){grid._mouseleaveTr(grid.element.find("tbody").children("tr:nth-child("+($tr.index()+1)+")")[0],event)}if(this._hoverTr){this._hoverTr.children("td,th").removeClass(css)}},_checkAndRenderHScrlbarCntnr:function(){var grid=this.grid,scroller=grid._hscrollbarcontent(),hscrollbar=grid._hscrollbar(),fixedControllerScrollerId=grid.id()+"_fixedContainerScroller",$fixedScroller=grid.container().find("#"+fixedControllerScrollerId);if($fixedScroller.length===0&&(this._isContinuousVirtualization()||$.ig.util.hasHorizontalScroll(grid.scrollContainer())||scroller.length===1&&hscrollbar.is(":visible"))){$('<div style="height:'+(hscrollbar.height()||$.ig.util.getScrollHeight())+'px" id="'+fixedControllerScrollerId+'"></div>').appendTo(this._containers.body.fixedContainer)}else if($fixedScroller.length===1&&hscrollbar.length===1){if(hscrollbar.is(":visible")){$fixedScroller.show()}else{$fixedScroller.hide()}}},syncRowsHeights:function($trs,$anotherRows){var i,len=$trs.length,hToSync,h,heights=[];for(i=0;i<len;i++){h=$.ig.util.isIE?$trs[i].getBoundingClientRect().height:$trs[i].offsetHeight;hToSync=$.ig.util.isIE?$anotherRows[i].getBoundingClientRect().height:$anotherRows[i].offsetHeight;hToSync=h>hToSync?h:hToSync;heights.push(hToSync)}for(i=0;i<len;i++){$trs[i].style.height=heights[i]+"px";$anotherRows[i].style.height=heights[i]+"px"}},_checkSyncTablesHeights:function(){if(!this._containers||!this._containers.body){this._populateContainers()}var h,fH,ufH,$fixedTable=this._containers.body.fixedTable,$unfixedTable=this._containers.body.unfixedTable,$fTRs=$fixedTable.children("tbody").children("tr"),$ufTRs=$unfixedTable.children("tbody").children("tr"),$lastTr=$ufTRs.last();if($lastTr.length>0&&(Math.abs($fixedTable.outerHeight()-$unfixedTable.outerHeight())>1||Math.abs($lastTr.igOffset().top-$fTRs.last().igOffset().top)>1)){this.syncRowsHeights($fTRs,$ufTRs);fH=$fixedTable.height();ufH=$unfixedTable.height();h=fH>ufH?fH:ufH;$fixedTable.height(h);$unfixedTable.height(h)}},_syncContainerHeights:function(){var $fixedTable,$unfixedTable,containers=this._containers;if(containers&&containers.body){$fixedTable=containers.body.fixedTable;$unfixedTable=containers.body.unfixedTable;if($fixedTable.height()!==$unfixedTable.height()){$fixedTable.height($unfixedTable.height())}}},_adjustWidthOnFixingRight:function(){if(this.options.fixingDirection!=="right"||this.grid._gridHasWidthInPercent()||this._isVirtualGrid()){return}var $mfc,grid=this.grid,c=this._containers.body;if(c.unfixedContainer.width()-c.unfixedTable.width()>=0){$mfc=this._mainFixedCntnr||this._containers.body.fixedContainer;if($mfc.length){$mfc[0].style.width=parseFloat(grid.options.width)-grid.element.width()+"px"}}},_adjustVirtWidthOnFixingRight:function(isToFix){if(this.options.fixingDirection!=="right"){return}var grid=this.grid,w,$tblHeaders,stw,$colgroup=grid._virtualcontainer().children("colgroup"),$colFixed=$colgroup.children("col[data-fixed-col]"),$colUnfixed=$colgroup.children("col:not(:last):not([data-fixed-col])");if($colUnfixed.length){w=$colUnfixed[0].width;this._containers.header.unfixedContainer.width(w);this._containers.footer.unfixedContainer.width(w)}if(grid.options.showHeader&&$colFixed.length){this._containers.header.fixedContainer.width(this._containers.header.fixedContainer.width()+grid._scrollbarWidth()+"px")}if(!isToFix&&!grid._fixedColumns.length){$tblHeaders=$("#"+grid.id()+"_headers_v");stw=$tblHeaders[0].style.width;if(stw&&stw.indexOf("%")===-1){$tblHeaders.width($tblHeaders.width()+grid._scrollbarWidth()+"px")}$tblHeaders.closest("td").attr("colspan",2)}grid._vhorizontalcontainer().css("overflow-y","hidden");this._updateHScrollbarTblWidthsInFixedVirtRight()},_updateFixedColgroupVirt:function(colWidthDelta){var w,$colFixed,$colUnfixed,$colgroup;$colgroup=this.grid._virtualcontainer().children("colgroup");$colFixed=$colgroup.children("col[data-fixed-col]");$colUnfixed=$colgroup.children("col:not(:last):not([data-fixed-col])");w=parseInt($colFixed.attr("width"),10);$colFixed.attr("width",w+colWidthDelta);w=parseInt($colUnfixed.attr("width"),10);$colUnfixed.attr("width",w-colWidthDelta)},getWidthOfFixedColumns:function(fCols,excludeNonDataColumns,includeHidden){var $fTable,w=0,i;if(!this._containers||!this._containers.body){this._populateContainers()}$fTable=this._containers.body.fixedTable;if(excludeNonDataColumns){$fTable.children("colgroup").children("col[data-skip]").each(function(){w+=parseInt($(this).css("width"),10)})}fCols=fCols||this.grid._fixedColumns;if(!fCols||!fCols.length){return w}for(i=0;i<fCols.length;i++){if(!includeHidden&&fCols[i].hidden){continue}w+=parseFloat(fCols[i].width)}return w},_updateHScrollbarWidthVirt:function(){var grid=this.grid,$hScrlbar,scrollbarWidth=grid._scrollbarWidth(),$hScrollerContainer=grid._vhorizontalcontainer(),fixedTableWidth=parseInt(this._containers.body.fixedTable[0].style.width,10),fdirLeft=this.options.fixingDirection==="left",gridWidth=parseInt(grid.options.width,10);if(grid._outerHScrollbar){$hScrlbar=grid._hscrollbar();if(this.options.fixingDirection==="left"){$hScrlbar.css("margin-left",fixedTableWidth)}else{$hScrlbar.css("margin-right",fixedTableWidth+scrollbarWidth)}if(grid._gridHasWidthInPercent()){grid._updateGridContentWidth();grid._updateVirtualHorizontalScrollbar()}else{grid._getHScrollContainerInner().css("width",grid.element.width())}return}if(this._isContinuousVirtualization()){if(fixedTableWidth===0){$hScrollerContainer.css({position:""})}else if(fdirLeft){$hScrollerContainer.css({position:"relative"})}if(!fdirLeft){gridWidth-=scrollbarWidth}$hScrollerContainer.width(gridWidth-fixedTableWidth+"px");grid._updateVirtualHorizontalScrollbar()}},_updateHScrollbarWidth:function(delta){if(this._isVirtualGrid()){return this._updateHScrollbarWidthVirt(delta)}var scrollContainer,grid=this.grid,$hScrollerContainer,scW,fdirLeft=this.options.fixingDirection==="left",oTableWidth=this._containers.body.unfixedTable.outerWidth();scrollContainer=this._containers.body.unfixedContainer;if(oTableWidth>0){$hScrollerContainer=grid._hscrollbar();if(scrollContainer.is(":visible")){scW=scrollContainer.width()}else{scW=parseInt(grid.options.width,10)-this.getWidthOfFixedColumns()}$hScrollerContainer.css({left:0});grid._hscrollbarinner().css({width:(grid._hasVerticalScrollbar&&grid.options.fixedHeaders&&fdirLeft?oTableWidth-grid._scrollbarWidth():oTableWidth)+"px",left:0})}},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.options.showFixButtons===false){return}var i,j,cs,columnKey,ths,children,isFixed=false,allowFixing=true,grid=this.grid,self=this,cols=grid.options.columns,colsLength=cols.length;if(grid._isMultiColumnGrid){ths=grid.headersTable().children("thead").children("tr[data-mch-level="+grid._maxLevel+"]").children("th");ths.each(function(){var $th=$(this);if($th.attr("data-mch-id")){columnKey=$th.attr("data-mch-id");allowFixing=true;cs=self._getColumnSettingByKey(columnKey);if(cs&&cs.allowFixing===false){return true}for(j=0;j<grid._oldCols.length;j++){if(grid._oldCols[j].identifier===columnKey){children=grid._oldCols[j].children;for(i=0;i<children.length;i++){cs=self._getColumnSettingByKey(children[i].key,i);if(cs&&cs.allowFixing===false){allowFixing=false;break}}break}}if(!allowFixing){return true}self._renderHeaderCellButton(columnKey,isFixed,true,$th)}else{if($th.attr("data-skip")){return true}columnKey=$th.attr("id").replace(grid.id()+"_","");cs=self._getColumnSettingByKey(columnKey);if(cs&&cs.allowFixing===false){return true}if(self._fcData[columnKey]!==true){self._renderHeaderCellButton(columnKey,isFixed,false,$th)}}})}else{for(i=0;i<colsLength;i++){columnKey=cols[i].key;cs=this._getColumnSettingByKey(columnKey,i);isFixed=false;if(cs!==null){if(cs.allowFixing===false){continue}if(cs.isFixed===true){isFixed=true}}if(this._fcData[columnKey]!==true){this._renderHeaderCellButton(columnKey,isFixed)}}}},_headerRendering:function(){var i;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Hiding"){this._hiding=this.grid.element.data("igGridHiding");break}}},_columnsMoved:function(e,ui){var start=ui.start,len=ui.len,idx=ui.index;if(!ui.isFixed||!start&&!len&&!idx||ui.owner.id()!==this.grid.id()){return}this.grid._rearrangeArray(this.grid._fixedColumns,start,len,idx)},_getColumnSettingByKey:function(key,colIndex){var i,cs=this.options.columnSettings,csLength=cs.length,res=null;for(i=0;i<csLength;i++){if(cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(cs[i].columnKey===key){res=cs[i];break}}else if(cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined){if(cs[i].columnIndex===colIndex){res=cs[i];break}}}return res},_id:function(){var i,res=this.grid.id(),argumentsLength=arguments.length;if(argumentsLength===0){return null}for(i=0;i<argumentsLength;i++){res+="_"+arguments[i]}return res},_renderHeaderCellButton:function(columnKey,isFixed,isGroupHeader,$th){var self=this,css=self.css,buttonId,gridId=this.grid.id(),$button,$divHeaderButtonContainer,$columnFixingHeaderIconContainer;if($th===undefined){$th=this.grid.container().find("#"+gridId+"_"+columnKey)}buttonId=this._id("header_cell","fixing",columnKey);if($th.length===0){return}this.grid._enableHeaderCellFeature($th);$columnFixingHeaderIconContainer=$th.find(".ui-iggrid-indicatorcontainer");if($columnFixingHeaderIconContainer.length===0){$columnFixingHeaderIconContainer=$('<div class="ui-iggrid-indicatorcontainer"></div>').appendTo($th)}$button=this.grid.container().find("#"+buttonId);if($button.length===0){$button=$("<a></a>").attr("href","#").attr("data-fixing-indicator","true").attr("id",buttonId);$divHeaderButtonContainer=$columnFixingHeaderIconContainer.find(".ui-iggrid-fixcolumn-headerbuttoncontainer");if($divHeaderButtonContainer.length===0){$divHeaderButtonContainer=$("<div></div>").addClass(css.headerButtonIconContainer).appendTo($columnFixingHeaderIconContainer)}$button.appendTo($divHeaderButtonContainer);$("<span></span>").appendTo($button);$button.bind({mousedown:function(){$(this).trigger("mouseout")},click:function(event){event.preventDefault();event.stopPropagation();if($button.attr("data-fixed")==="true"){self._unfixColumnInternal(columnKey)}else{self._fixColumnInternal(columnKey)}}})}this._changeStyleHeaderButton(columnKey,isFixed)},_getTH:function(id){return this.grid.container().find('th[data-mch-id="'+id+'"],th[id="'+this.grid.id()+"_"+id+'"]')},_changeStyleHeaderButton:function(columnKey,isFixed){var css=this.css,fc,attrVal="true",titleOption="headerFixButtonText",$button=this.grid.container().find("#"+this._id("header_cell","fixing",columnKey)),$span;$span=$button.find("span");if(isFixed){$span.removeClass(css.headerButtonIcon);$span.addClass(css.headerButtonUnfixIcon);titleOption="headerUnfixButtonText"}else{attrVal="false";$span.removeClass(css.headerButtonUnfixIcon);$span.addClass(css.headerButtonIcon)}$button.attr({title:this._getLocaleValue(titleOption),"data-localeid":titleOption,"data-localeattr":"title","data-fixed":attrVal});fc=this.grid.element.data("igGridFeatureChooser");if(fc){fc._setSelectedState("ColumnFixing",columnKey,isFixed,false)}},_dataRendering:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}if(this.grid.options.height===null&&this.grid.hasFixedColumns()&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){$("#"+this.grid.id()+"_fixed").height("")}},_dataRendered:function(event,ui){if(ui===undefined||this.grid.id()!==ui.owner.id()){return}var grid=this.grid,fixedContainer,scrollContainer;if(grid.hasFixedColumns()){if(this.options.syncRowHeights){this.checkAndSyncHeights();if(this._isVirtualGrid()&&grid._virtualcontainer().outerHeight()>parseInt(grid.options.height)){grid._initializeHeights()}if($.ig.util.isIE){scrollContainer=this._containers.body.unfixedContainer;fixedContainer=this._containers.body.fixedContainer;this._syncScrollTopContainers(fixedContainer,scrollContainer)}}}},_colCollectionModified:function(){var i=0;this.grid._fixedColumns=[];for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].fixed&&!this.grid.options.columns[i].hidden){this.grid._fixedColumns.push(this.grid.options.columns[i])}}},_gridContainersRendered:function(){var i,j,cs=this.options.columnSettings,csLength=cs.length,columnKeys=[],hasColumnKey,hasColumnIndex,res,cols=this.grid.options.columns,col,countHidden=0,colsLength=cols.length;for(i=0;i<csLength;i++){if(cs[i].isFixed!==true){continue}hasColumnKey=cs[i].columnKey!==null&&cs[i].columnKey!==undefined;hasColumnIndex=cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined;if(!hasColumnKey){if(!hasColumnIndex){continue}if(cs[i].columnIndex>=0&&cs[i].columnIndex<colsLength){columnKeys.push(cols[cs[i].columnIndex].key);if(cols[cs[i].columnIndex].hidden){countHidden++}}}else{columnKeys.push(cs[i].columnKey);col=this.grid.columnByKey(cs[i].columnKey);if(col&&col.hidden){countHidden++}}}if(countHidden>0){throw new Error($.ig.util.stringFormat(this._getLocaleValue("initialFixingNotApplied"),columnKeys[0],this._getLocaleValue("alreadyHiddenError")))}for(j=0;j<columnKeys.length;j++){res=this.fixColumn(columnKeys[j])}if(this.options.fixNondataColumns){this.fixDataSkippedColumns()}},_detachEvents:function(){if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerRenderingHandler){this.grid.element.unbind("iggridheaderrendering",this._headerRenderingHandler)}if(this._columnsMovedHandler){this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler)}if(this._gridHeightChangingHandler){this.grid.element.unbind("iggrid_heightchanging",this._gridHeightChangingHandler)}if(this._dataRenderingHandler){this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler)}if(this._dataRenderedHandler){this.grid.element.unbind("iggriddatarendered",this._dataRenderedHandler)}if(this._virtualrecordsrenderHandler){this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualrecordsrenderHandler)}if(this._gridContainerHeightHandler){this.grid.element.unbind("iggrid_heightchanged",this._gridContainerHeightHandler)}if(this._gridContainersRenderedHandler){this.grid.element.unbind("iggrid_gridcontainersrendered",this._gridContainersRenderedHandler)}if(this._gridColCollectionModified){this.grid.element.unbind("iggridcolumnscollectionmodified",this.gridColCollectionModified)}if(this._lastColumnWidthAutoAdjustedHandler){this.grid.element.unbind("iggrid_lastcolumnwidthautoadjusted",this._lastColumnWidthAutoAdjustedHandler);
}},destroy:function(){var fc;if(this.grid._fixedColumns&&this.grid._fixedColumns.length>0){this.unfixAllColumns()}if(this.grid.hasFixedDataSkippedColumns()){this.unfixNonDataColumns()}this.grid._hasFixedDataSkippedColumns=false;this.grid._hasFixedColumns=false;this.element.data("fixingApplied",false);this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);th.find("a[data-fixing-indicator=true]").parent().remove()});this._detachEvents();if(this._gridRenderRowHandler!==undefined){this.grid._renderRow=this._gridRenderRowHandler}if(this._gridRenderRecordsForTableHandler){this.grid._renderRecordsForTable=this._gridRenderRecordsForTableHandler}if(this._gridRenderNewRowHandler){this.grid.renderNewRow=this._gridRenderNewRowHandler}if(this._gridDetachColumnHandler){this.grid._detachColumn=this._gridDetachColumnHandler}if(this._gridAttachColumnHandler){this.grid._attachColumn=this._gridAttachColumnHandler}if(this._gridRerenderColgroupsHandler){this.grid._rerenderColgroups=this._gridRerenderColgroupsHandler}if(this._gridRenderColgroupHandler){this.grid._renderColgroup=this._gridRenderColgroupHandler}if(this._gridUpdatePaddingHandler){this.grid._updateVScrollbarCellPaddingHelper=this._gridUpdatePaddingHandler}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("ColumnFixing")}this._unregisterSetOptionCallback();this._superApply(arguments);return this},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isInitFC!==true){this._initFC()}},_setFixedBodyCntnrHeight:function(scrollContainer,fixedBodyContainer){if(!this._containers||!this._containers.body){this._populateContainers()}var grid=this.grid,hScrlbar,scrollContainerHeight,wperc,v;fixedBodyContainer=fixedBodyContainer||this._containers.body.fixedContainer;scrollContainer=scrollContainer||this._containers.body.unfixedContainer;if(grid.options.height!==null){scrollContainerHeight=scrollContainer.height();hScrlbar=grid._hscrollbar();wperc=grid._gridHasWidthInPercent();v=this._isVirtualGrid();if(hScrlbar.is(":visible")&&(!v||!wperc&&v&&this._isContinuousVirtualization())){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}}fixedBodyContainer.height(scrollContainerHeight)},_summariesHeightsAdjusting:function(){var $fTbl,$ufTbl,grid=this.grid;if(!grid._initialized){if(grid.options.showFooter&&!grid.options.fixedFooters){grid._updateVerticalScrollbarCellPadding()}return}if(!this._containers||!this._containers.footer){this._populateContainers()}if(grid.options.showFooter&&grid.options.fixedFooters){$fTbl=this._containers.footer.fixedTable;$ufTbl=this._containers.footer.unfixedTable;this._syncHeightsForTables($fTbl,$ufTbl)}},_heightChanged:function(){var grid=this.grid;if(!grid.hasFixedColumns()){return}this._syncTableHeights();this._setFixedBodyCntnrHeight();this._checkAndRenderHScrlbarCntnr();if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_lastColumnWidthAutoAdjusted:function(e,args){var grid=this.grid;if(grid.hasFixedColumns()){if(this.options.fixingDirection==="right"&&!grid._initialized){grid._hscrollbarcontent().css("overflow-y","hidden");this._updateHScrollbarWidth();this._adjustWidthOnFixingRight()}if(args&&args.specialColumnsWidth){this._recalcTableWidths();this._updateHScrollbarWidth();this._updateGridWidth();grid._updateHScrollbarVisibility()}}},_gridHeightChanging:function(e,arg){if(!this._containers.body){return}if(this._isVirtualGrid()){return}var scrollContainerHeight,diff,pc=this.grid._prevContainerHeight,$fixedBodyContainer=this.grid.fixedBodyContainer();if($fixedBodyContainer.length===0){return}scrollContainerHeight=arg.ch-arg.h;if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}$fixedBodyContainer.height(scrollContainerHeight);diff=Math.abs(pc-this.grid.container().height());$fixedBodyContainer.height(scrollContainerHeight-diff)},_initFC:function(){var i,fc,isMCH=this.grid._isMultiColumnGrid,o=this.options,cols=this.grid.options.columns,colsLength=cols.length,cs,columnKey;this._isInitFC=true;fc=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined&&this.renderInFeatureChooser&&o.showFixButtons){if(isMCH){cols=this.grid._oldCols;colsLength=cols.length}for(i=0;i<colsLength;i++){columnKey=cols[i].key;this._fcData[columnKey]=false;if(isMCH&&cols[i].level!==0){continue}cs=this._getColumnSettingByKey(columnKey,i);if(cs&&cs.allowFixing===false){continue}if(fc._shouldRenderInFeatureChooser(columnKey)===true){fc._renderInFeatureChooser(columnKey,{name:"ColumnFixing",text:this._getLocaleValue("featureChooserTextUnfixedColumn"),textHide:this._getLocaleValue("featureChooserTextFixedColumn"),iconClass:this.css.featureChooserIconClassFixed,iconClassOff:this.css.featureChooserIconClassUnfixed,isSelected:cs&&cs.isFixed===true,method:$.proxy(this._togglefromfc,this),updateOnClickAll:false,order:3,groupName:"toggle",groupOrder:1,type:"toggle",state:"hide"});this._fcData[columnKey]=true}}}},_togglefromfc:function(event,columnKey){var i,cols=this.grid.options.columns,colsLength=cols.length,col,ret;for(i=0;i<colsLength;i++){col=cols[i];if(col.key===columnKey){ret=col.fixed===true?this._unfixColumnInternal(columnKey):this._fixColumnInternal(columnKey);break}}return ret.error===undefined},_columnMap:function(){var i,j,isMCH=this.grid._isMultiColumnGrid,cs,columnKey,elem,result=[],cols=this.grid.options.columns,colsLength=cols.length;if(this.options.showFixButtons===false){return false}for(i=0;i<colsLength;i++){columnKey=cols[i].key;elem={columnKey:columnKey,enabled:true};cs=this._getColumnSettingByKey(columnKey,i);if(cs&&cs.allowFixing===false){elem.enabled=false}else if(isMCH){for(j=0;j<this.grid._oldCols.length;j++){if(this.grid._oldCols[j].key===columnKey){break}}if(j===this.grid._oldCols.length){elem.enabled=false}}result.push(elem)}return result},_cleanupTBody:function(){if(this.grid.hasFixedColumns()){if(!this._containers||!this._containers.body){this._populateContainers()}this._containers.body.fixedTable.children("tbody").empty()}},_renderRow:function(rec,tr,rowId){if(!this.grid.hasFixedColumns()){return this._gridRenderRowHandler(rec,tr,rowId)}var i,col,content,$fixedRow,$unfixedRow,fixedCells,unfixedCells,counterFixed=0,counterUnfixed=0,$td,$tr=$(tr),grid=this.grid,cols=grid.options.columns,colsLength=cols.length,isFixedRow=this.grid._isFixedElement($tr);if(isFixedRow){$fixedRow=$tr;$unfixedRow=grid.element.find("tbody tr:nth-child("+($tr.index()+1)+")")}else{$unfixedRow=$tr;$fixedRow=this.grid.fixedTable().find("tbody tr:nth-child("+($tr.index()+1)+")")}fixedCells=$fixedRow.find(">td:not([data-skip])");unfixedCells=$unfixedRow.find(">td:not([data-skip])");for(i=0;i<colsLength;i++){col=cols[i];if(col.hidden===true){continue}if(col.fixed===true){$td=fixedCells.eq(counterFixed++)}else{$td=unfixedCells.eq(counterUnfixed++)}if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){$td.html($(content).html())}else{$td.html(content)}}else{$td.html(String(grid._renderCell(rec[col.key],col,rec)))}}return tr},_renderRecordsForTable:function(start,end){var $fTable;if(this.grid.hasFixedColumns()){$fTable=this._containers.body.fixedTable;if($fTable.length){this._gridRenderRecordsForTableHandler.call(this.grid,start,end,$fTable,$fTable.children("tbody"),true)}}this._gridRenderRecordsForTableHandler.apply(this.grid,arguments);if($fTable&&this.options.syncRowHeights&&this._applySyncRowHeights!==false){this._syncHeightsForTables($fTable,this.grid.element)}},_renderNewRow:function(rec){var grid=this.grid,tbody=this.grid.element.children("tbody"),index=tbody.children('[data-container!="true"]').length,virt=grid.options.virtualization===true||grid.options.rowVirtualization===true;this._gridRenderNewRowHandler.apply(this.grid,arguments);if(!virt){if(grid.hasFixedColumns()){MSApp.execUnsafeLocalFunction(function(){grid.fixedTable().children("tbody").append(grid._renderRecord(rec,index,true))})}}},_removeCellPaddingForAllColumns:function(rmvInFixedCntnr){var grid=this.grid;grid._removeHeaderCellPadding(!rmvInFixedCntnr?grid.fixedHeadersTable():grid.headersTable(),true);grid._removeCellPadding(!rmvInFixedCntnr?grid.fixedBodyContainer():grid.element,"tbody","td",true);grid._removeCellPadding(!rmvInFixedCntnr?grid.fixedFootersTable():grid.footersTable(),"tfoot","td",true)},_updateVScrollbarCellPaddingHelper:function(paddingIncrement,skipHeaderFooters){if(!this.grid.hasFixedColumns()){this._gridUpdatePaddingHandler(paddingIncrement,skipHeaderFooters);return}var grid=this.grid,gridOpts=grid.options,fTable,hTable,container,fDirRight=this.options.fixingDirection==="right",c=this._containers;if(!gridOpts.height){return}if(!skipHeaderFooters){if(grid._initialized){this._removeCellPaddingForAllColumns(fDirRight)}if(fDirRight){paddingIncrement-=c.body.fixedContainer.width()-c.body.fixedTable.width();if(paddingIncrement<=0){return}}if(gridOpts.showHeader){hTable=!fDirRight?grid.headersTable():grid.fixedHeadersTable();grid._increaseLastHeaderCellVScrollbarPadding(hTable,paddingIncrement)}if(gridOpts.showFooter){fTable=!fDirRight?grid.footersTable():grid.fixedFootersTable();grid._increaseLastCellVScrollbarPadding(fTable,"tfoot","td",paddingIncrement)}}container=!fDirRight?grid.element:grid.fixedTable();grid._increaseLastCellVScrollbarPadding(container,"tbody","td",paddingIncrement)},_syncHeightsForTables:function($fixedTable,$unfixedTable,resetHeights){var h,fH,ufH;resetHeights=resetHeights||$unfixedTable.length&&$unfixedTable[0].style.height!=="";$fixedTable.css("height","");$unfixedTable.css("height","");if(this.options.syncRowHeights){this.syncRowsHeights($fixedTable.children("tbody").children("tr"),$unfixedTable.children("tbody").children("tr"))}if(resetHeights){fH=$fixedTable.height();ufH=$unfixedTable.height();h=fH>ufH?fH:ufH;$fixedTable.height(h);$unfixedTable.height(h)}},_detachColumn:function(col){if(!this.grid.hasFixedColumns()){return this._gridDetachColumnHandler(col)}var pos,fixed,headerCells,grid=this.grid,$tbl,footerCells;fixed=col.fixed;col.hidden=false;grid._visibleColumnsArray=undefined;pos=grid.getVisibleIndexByKey(col.key);col.hidden=true;grid._visibleColumnsArray=undefined;grid._initializeDetachedContainers();if(grid._isMultiColumnGrid){grid._hideMultiHeaderCells(grid._headerCells,col.key)}$tbl=fixed?grid.fixedHeadersTable():grid.headersTable();headerCells=grid._isMultiColumnGrid?$tbl.children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]"):$tbl.children("thead").children("tr").not("[data-skip=true]");grid._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},pos,grid._detachedHeaderCells,col.key);$tbl=fixed?grid.fixedFootersTable():grid.footersTable();footerCells=$tbl.children("tfoot").children("tr");grid._detachCells(footerCells,function(row){return row.children("td").not("[data-skip=true]")},pos,grid._detachedFooterCells,col.key)},_attachColumn:function(col){if(!this.grid.hasFixedColumns()){this._gridAttachColumnHandler(col);return}var headerCells,footerCells,fixed=col.fixed,$tbl,grid=this.grid,pos=grid.getVisibleIndexByKey(col.key);grid._initializeDetachedContainers();if(grid._isMultiColumnGrid){grid._showMultiHeaderCells(col.key)}$tbl=fixed?grid.fixedHeadersTable():grid.headersTable();headerCells=grid._isMultiColumnGrid?$tbl.children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]"):$tbl.children("thead").children("tr").not("[data-skip=true]");grid._attachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},pos,grid._detachedHeaderCells,col.key);$tbl=fixed?grid.fixedFootersTable():grid.footersTable();footerCells=$tbl.children("tfoot").children("tr");grid._attachCells(footerCells,function(row){return row.children("td").not("[data-skip=true]")},pos,grid._detachedFooterCells,col.key)},_rerenderColgroups:function(){var grid=this.grid,c=this._containers,fc=grid.hasFixedColumns();if(fc){if(this._isVirtualGrid()){c.body.fixedTable.children("colgroup").remove();c.header.fixedTable.children("colgroup").remove();c.footer.fixedTable.children("colgroup").remove()}else{grid.fixedContainer().find("colgroup").remove()}}this._gridRerenderColgroupsHandler.apply(this.grid,arguments)},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){var fc=this.grid.hasFixedColumns();if(fc){this._gridRenderColgroupHandler(document.getElementById(table.id+"_fixed"),isHeader,isFooter,false,{fixed:true})}this._gridRenderColgroupHandler(table,isHeader,isFooter,autofitLastColumn)},_resizeEl:function($e,delta){var w=this._calcTblWidth($e,delta);$e[0].style.width=w;return w},_containerResized:function(isFixed,deltaWidth){if(!this.grid.hasFixedColumns()){return}var grid=this.grid,w,v=this._isVirtualGrid();if(!this._containers||!this._containers.body){this._populateContainers()}if(isFixed){deltaWidth=-deltaWidth||0;w=this._resizeEl(this._containers.body.fixedTable,deltaWidth);if(grid.options.fixedHeaders&&grid.options.showHeader){w=this._resizeEl(this._containers.header.fixedTable,deltaWidth)}if(grid.options.fixedFooters&&grid.options.showFooter){w=this._resizeEl(this._containers.footer.fixedTable,deltaWidth)}if(v){this._resizeEl(this._containers.body.fixedContainer,deltaWidth);if(grid.options.fixedHeaders&&grid.options.showHeader){w=this._resizeEl(this._containers.header.fixedContainer,deltaWidth)}if(grid.options.fixedFooters&&grid.options.showFooter){w=this._resizeEl(this._containers.footer.fixedContainer,deltaWidth)}this._updateVirtualDOMWidth(deltaWidth)}else{this._mainFixedCntnr[0].style.width=w}this._updateHScrollbarWidth();this._updateGridWidth();grid._updateHScrollbarVisibility()}if(grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer()}if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_checkGridSupportedFeatures:function(){var self=this;if(this.grid.options._isHierarchicalGrid){throw new Error(this._getLocaleValue("hierarchicalGridNotSupported"))}var i,featureName,gridOptions=this.grid.options,cols=gridOptions.columns,dW=gridOptions.defaultColumnWidth,features=gridOptions.features,featuresLength=features.length;if(gridOptions.width===null||gridOptions.width===""){throw new Error(this._getLocaleValue("noGridWidthNotSupported"))}if(dW){if($.type(dW)==="string"&&dW.indexOf("%")>0){throw new Error(this._getLocaleValue("defaultColumnWidthInPercentageNotSupported"))}}$.each(cols,function(ind,col){var w=col.width;if(!w&&!dW||$.type(w)==="string"&&w.indexOf("%")>0){throw new Error(self._getLocaleValue("columnsWidthShouldBeSetInPixels").replace("{key}",col.key))}});$.each(cols,function(ind,col){if(col.unbound){throw new Error(self._getLocaleValue("unboundColumnsNotSupported"))}});if(gridOptions.columnVirtualization===true){throw new Error(this._getLocaleValue("columnVirtualizationNotSupported"))}if(gridOptions.width===null||gridOptions.width===""){throw new Error(this._getLocaleValue("noGridWidthNotSupported"))}if(gridOptions.virtualization&&gridOptions.virtualizationMode!=="continuous"){throw new Error(this._getLocaleValue("virtualizationNotSupported"))}if(featuresLength===1){return}for(i=0;i<featuresLength;i++){featureName=features[i].name;if(!featureName){continue}featureName=featureName.toLowerCase();switch(featureName){case"groupby":throw new Error(this._getLocaleValue("groupByNotSupported"));case"responsive":throw new Error(this._getLocaleValue("responsiveNotSupported"))}}},_updateWidthsOnHiding:function(width,fixed){var $bodyTbl,$headerTbl,$footerTbl,funcUpdateTbl,$bodyContainer,$headerContainer,$footerContainer;this._populateContainers();$bodyTbl=fixed?this._containers.body.fixedTable:this._containers.body.unfixedTable;$bodyContainer=fixed?this._containers.body.fixedContainer:this._containers.body.unfixedContainer;if(this._containers.header){$headerTbl=fixed?this._containers.header.fixedTable:this._containers.header.unfixedTable;$headerContainer=fixed?this._containers.header.fixedContainer:this._containers.header.unfixedContainer}if(this._containers.footer){$footerTbl=fixed?this._containers.footer.fixedTable:this._containers.footer.unfixedTable;$footerContainer=fixed?this._containers.footer.fixedContainer:this._containers.footer.unfixedContainer}funcUpdateTbl=function(nW,$tbl){if(!$tbl||!$tbl.length){return}var w=$tbl[0].style.width;if($.type(w)==="string"&&(w.indexOf("%")!==-1||w==="")){return}w=parseInt($tbl[0].style.width,10);if(isNaN(w)){w=$tbl.outerWidth()}w+=nW;$tbl[0].style.width=w+"px"};funcUpdateTbl(width,$bodyTbl);funcUpdateTbl(width,$headerTbl);funcUpdateTbl(width,$footerTbl);if(fixed&&this._mainFixedCntnr){this._mainFixedCntnr.css("width",parseFloat(this._mainFixedCntnr[0].style.width)+width+"px")}if(this._isVirtualGrid()){if(fixed){this._updateFixedColgroupVirt(width);if(!this.grid._gridHasWidthInPercent()){funcUpdateTbl(-width,this._containers.body.unfixedContainer);if(this.grid.options.showHeader){funcUpdateTbl(-width,this._containers.header.unfixedContainer)}if(this.grid.options.showFooter){funcUpdateTbl(-width,this._containers.footer.unfixedContainer)}}this._updateHScrollbarWidthVirt()}funcUpdateTbl(width,$bodyContainer);funcUpdateTbl(width,$headerContainer);funcUpdateTbl(width,$footerContainer)}},_hidingFinishing:function(args){if(!this.grid.hasFixedColumns()){return}var i,grid=this.grid,cols=args.columns,w,col;for(i=0;i<cols.length;i++){col=cols[i];if(col.fixed){w=parseInt(col.width,10);this._updateWidthsOnHiding(args.hidden?-w:w,true)}}this._populateContainers();grid._columnMovingResets()},_hidingFinished:function(args){if(!this.grid.hasFixedColumns()){return}var $trs,virt=this._isVirtualGrid(),c=this._containers;this._populateContainers();if(virt){this._recalcTableWidths();if(this.options.fixingDirection==="right"){this._adjustVirtWidthOnFixingRight(false)}}if(this.options.syncRowHeights){if(!args.hidden){$trs=c.body.fixedTable.children("tbody").find(">tr");$trs=$trs.add(c.body.unfixedTable.children("tbody").find(">tr"));$trs.each(function(ind,tr){tr.style.height=""})}if(virt&&!this._isContinuousVirtualization()){if(this.options.syncRowHeights){this.syncRowsHeights(this.grid.fixedTable().children("tbody").children("tr"),this.grid.element.children("tbody").children("tr"))}}else{this._syncHeightsForTables(this.grid.fixedTable(),this.grid.element)}if(this.grid.options.showFooter){if(c.footer){this.syncRowsHeights(c.footer.fixedTable.children("tfoot").children("tr"),c.footer.unfixedTable.children("tfoot").children("tr"))}}}if(this.grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer()}this._applySyncRowHeights=true},_syncRowsOnAddEdit:function(rowId){if(!this.options.syncRowHeights||!this.grid.hasFixedColumns()){return}var h,c=this._containers,$fRow=this.grid.rowById(rowId,true),$ufRow=this.grid.rowById(rowId);if(!$fRow||!$ufRow){return}if(!c||!c.body){this._populateContainers()}h=c.body.fixedTable.height();c.body.fixedTable.height("");c.body.unfixedTable.height("");$fRow.height("");$ufRow.height("");this.syncRowsHeights($fRow,$ufRow);c.body.fixedTable.height(h);c.body.unfixedTable.height(h);this.checkAndSyncHeights()},_internalRowDeleted:function(){if(!this.options.syncRowHeights||!this.grid.hasFixedColumns()){return}var c=this._containers;if(!c||!c.body){this._populateContainers()}if(!this._isVirtualGrid()){c.body.fixedTable.height("");c.body.unfixedTable.height("")}this.checkAndSyncHeights()},_internalRowAdded:function(args){if(!this.grid.hasFixedColumns()){return}this._syncRowsOnAddEdit(args.row.attr("data-id"))},_internalCellUpdated:function(args){if(!this.grid.hasFixedColumns()){return}this._syncRowsOnAddEdit(args.rowID)},_internalRowUpdated:function(args){if(!this.grid.hasFixedColumns()){return}this._syncRowsOnAddEdit(args.rowID)},_removeRowsHeights:function($rows,removeAttr){var i,len=$rows.length;for(i=0;i<len;i++){$rows[i].style.height="";if(removeAttr){$rows[i].removeAttribute("height")}}},_virtualrecordsrender:function(){var grid=this.grid,fnRemoveHeigths,h,$fixedTable,$unfixedTable,fc,ufc,$fRows,$ufRows,cvirt=this._isContinuousVirtualization();if(!grid.hasFixedColumns()||!this.options.syncRowHeights){return}$fixedTable=this._containers.body.fixedTable;$unfixedTable=this._containers.body.unfixedTable;h=$unfixedTable[0].style.height;$fixedTable.height("");$unfixedTable.height("");if(cvirt){this._checkSyncTablesHeights();if(!$.ig.util.isIE){fc=this._scrollContainers.fCntnr;ufc=this._scrollContainers.ufCntnr;fc.scrollTop(ufc.scrollTop())}return}fnRemoveHeigths=function($rows){var i,len=$rows.length;for(i=0;i<len;i++){$rows[i].style.height=""}};$ufRows=$unfixedTable.children("tbody").children("tr");$fRows=$fixedTable.children("tbody").children("tr");this._removeRowsHeights($ufRows);this._removeRowsHeights($fRows);this.syncRowsHeights($ufRows,$fRows);$fixedTable.height(h);$unfixedTable.height(h)},_setFixingStateByCol:function(col,isFixed){var i,len;col.fixed=isFixed;if(col.group){len=col.group.length;for(i=0;i<len;i++){this._setFixingStateByCol(col.group[i],isFixed)}}},_unregisterSetOptionCallback:function(){var callbacks=this.grid._setOptionCallbacks,i,len=callbacks.length;for(i=0;i<len;i++){if(callbacks[i].type==="ColumnFixing"){$.ig.removeFromArray(callbacks,i);break}}},_registerSetOptionCallback:function(){var callbacks=this.grid._setOptionCallbacks,i,len=callbacks.length;for(i=0;i<len;i++){if(callbacks[i].type==="ColumnFixing"){break}}if(i===len){callbacks.push({type:"ColumnFixing",func:$.proxy(this._gridSetOption,this)})}},_updateHScrollbarTblWidthsInFixedVirtRight:function(){var $hScrlBar,$hScrlBarInner;$hScrlBarInner=this.grid._getHScrollContainerInner();$hScrlBar=$hScrlBarInner.parent();if(!this.grid._gridHasWidthInPercent){$hScrlBar.width(this._containers.body.unfixedContainer.width())}$hScrlBarInner.width(this._containers.body.unfixedTable.width());$hScrlBar.css("overflow-y","hidden");if(this._containers.header){this._containers.header.unfixedTable.css("width","");this._containers.header.unfixedTable.css("width",this._calcTblWidth(this._containers.header.unfixedTable,0))}if(this._containers.footer){this._containers.footer.unfixedTable.css("width","");this._containers.footer.unfixedTable.css("width",this._calcTblWidth(this._containers.footer.unfixedTable,0))}this._updateGridWidth();this.grid._updateHScrollbarVisibility()},_rollbackApplied:function(){if(!this._containers||!this._containers.body){this._populateContainers()}this._containers.body.fixedTable.height("");this._containers.body.unfixedTable.height("");if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_gridRendered:function(){if(this.options.fixingDirection==="right"&&this._isVirtualGrid()&&this.grid.hasFixedColumns()){this._updateHScrollbarTblWidthsInFixedVirtRight()}},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(isRebind===true){return}this.grid._fixedColumns=this.grid._fixedColumns||[];this.grid._fixingDirection=this.options.fixingDirection;this._checkGridSupportedFeatures();this._registerSetOptionCallback();this._detachEvents();this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this._headerRenderingHandler=$.proxy(this._headerRendering,this);this.grid.element.bind("iggridheaderrendering",this._headerRenderingHandler);this._columnsMovedHandler=$.proxy(this._columnsMoved,this);this.grid.element.bind("iggrid_columnsmoved",this._columnsMovedHandler);if(this._isVirtualGrid()&&this.options.syncRowHeights){this._virtualrecordsrenderHandler=$.proxy(this._virtualrecordsrender,this);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualrecordsrenderHandler)}this._gridContainerHeightHandler=$.proxy(this._heightChanged,this);this.grid.element.bind("iggrid_heightchanged",this._gridContainerHeightHandler);this._gridHeightChangingHandler=$.proxy(this._gridHeightChanging,this);this.grid.element.bind("iggrid_heightchanging",this._gridHeightChangingHandler);this._gridContainersRenderedHandler=$.proxy(this._gridContainersRendered,this);this.grid.element.bind("iggrid_gridcontainersrendered",this._gridContainersRenderedHandler);if(this.grid._columns===undefined||this.grid._columns===null){this.grid._columns=this.grid.options.columns.clone()}if(this.grid._fixedColumns===undefined){this.grid._fixedColumns=[]}if(this.grid.options.height===null&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){this._dataRenderingHandler=$.proxy(this._dataRendering,this);this.grid.element.bind("iggriddatarendering",this._dataRenderingHandler)}this._dataRenderedHandler=$.proxy(this._dataRendered,this);this.grid.element.bind("iggriddatarendered",this._dataRenderedHandler);this._lastColumnWidthAutoAdjustedHandler=$.proxy(this._lastColumnWidthAutoAdjusted,this);this.grid.element.bind("iggrid_lastcolumnwidthautoadjusted",this._lastColumnWidthAutoAdjustedHandler);this._gridColCollectionModified=$.proxy(this._colCollectionModified,this);this.grid.element.bind("iggridcolumnscollectionmodified",this._gridColCollectionModified);if(!this._isFunctionsOverriden){this.grid._visibleAreaWidth(this.options.minimalVisibleAreaWidth);this._gridRenderRowHandler=$.proxy(this.grid._renderRow,this.grid);this._renderRowHandler=$.proxy(this._renderRow,this);this.grid._renderRow=this._renderRowHandler;this._gridRenderRecordsForTableHandler=$.proxy(this.grid._renderRecordsForTable,this.grid);this._renderRecordsForTableHandler=$.proxy(this._renderRecordsForTable,this);this.grid._renderRecordsForTable=this._renderRecordsForTableHandler;this._gridRenderNewRowHandler=$.proxy(this.grid.renderNewRow,this.grid);this._renderNewRowHandler=$.proxy(this._renderNewRow,this);this.grid.renderNewRow=this._renderNewRowHandler;this._gridDetachColumnHandler=$.proxy(this.grid._detachColumn,this.grid);this._detachColumnHandler=$.proxy(this._detachColumn,this);this.grid._detachColumn=this._detachColumnHandler;this._gridAttachColumnHandler=$.proxy(this.grid._attachColumn,this.grid);this._attachColumnHandler=$.proxy(this._attachColumn,this);this.grid._attachColumn=this._attachColumnHandler;this._gridRerenderColgroupsHandler=$.proxy(this.grid._rerenderColgroups,this.grid);this._rerenderColgroupsHndlr=$.proxy(this._rerenderColgroups,this);this.grid._rerenderColgroups=this._rerenderColgroupsHndlr;this._gridRenderColgroupHandler=$.proxy(this.grid._renderColgroup,this.grid);this._renderColgroupHandler=$.proxy(this._renderColgroup,this);this.grid._renderColgroup=this._renderColgroupHandler;this._gridUpdatePaddingHandler=$.proxy(this.grid._updateVScrollbarCellPaddingHelper,this.grid);this._updateVScrollbarCellPaddingHelperHandler=$.proxy(this._updateVScrollbarCellPaddingHelper,this);this.grid._updateVScrollbarCellPaddingHelper=this._updateVScrollbarCellPaddingHelperHandler;this._isFunctionsOverriden=true}}});$.extend($.ui.igGridColumnFixing,{version:"21.2.12"});return $});