/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 15.2.20152.1027
 *
 * Copyright (c) 2011-2015 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.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
if(typeof jQuery!=="function"){throw new Error("jQuery is undefined")}(function($){$.widget("ui.igGridSorting",{css:{sortableColumnHeader:"ui-iggrid-sortableheader ui-state-default",sortableColumnHeaderActive:"ui-iggrid-sortableheaderactive ui-state-active",sortableColumnHeaderHover:"ui-iggrid-sortableheaderhover ui-state-hover",sortableColumnHeaderFocus:"ui-iggrid-sortableheaderfocus ui-state-focus",ascendingColumnHeader:"ui-iggrid-colheaderasc",descendingColumnHeader:"ui-iggrid-colheaderdesc",ascendingColumn:"ui-iggrid-colasc ui-state-highlight",descendingColumn:"ui-iggrid-coldesc ui-state-highlight",sortIndicator:"ui-iggrid-colindicator",fcSortIndicatorAscending:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-sort-a-z",fcSortIndicatorDescending:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-sort-z-a",sortIndicatorAscending:"ui-iggrid-colindicator-asc ui-icon ui-icon-arrowthick-1-n",sortIndicatorDescending:"ui-iggrid-colindicator-desc ui-icon ui-icon-arrowthick-1-s",dialogSortedColumns:"ui-iggrid-sorting-dialog-sortedcolumns",dialogUnsortedColumns:"ui-iggrid-sorting-dialog-unsortedcolumns",dialogUnsortedColumnsSortByButton:"ui-iggrid-sorting-dialog-unsortedcolumns-sortbybutton",dialogAsdDescButton:"ui-iggrid-sorting-dialog-ascdescbutton",modalDialogSortByColumn:"ui-iggrid-sorting-dialog-sortbybutton",dialogSortedColumnsItem:"ui-widget-content",dialogUnsortedColumnsItem:"ui-widget-content",dialogButtonAsc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonAscIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-n",dialogButtonDesc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonDescIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-s",dialogButtonUnsort:"ui-iggrid-sorting-dialog-sortbybuttons ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-widget-content ui-igbutton-remove",dialogButtonUnsortContainer:"ui-button-icon-primary ui-icon ui-icon-circle-close",dialogSortedColumnTextContainer:"ui-iggrid-dialog-text",dialogItemText:"ui-iggrid-dialog-text",dialogButtonsHover:"ui-state-hover",featureChooserModalDialogIcon:"ui-icon ui-iggrid-icon-multiple-sorting"},options:{type:null,caseSensitive:false,applySortedColumnCss:true,sortUrlKey:null,sortUrlKeyAscValue:null,sortUrlKeyDescValue:null,mode:"single",customSortFunction:null,firstSortDirection:"ascending",sortedColumnTooltip:$.ig.GridSorting.locale.sortedColumnTooltipFormat,modalDialogSortOnClick:false,modalDialogSortByButtonText:$.ig.GridSorting.locale.modalDialogSortByButtonText,modalDialogResetButtonLabel:$.ig.GridSorting.locale.modalDialogResetButton,modalDialogCaptionButtonDesc:$.ig.GridSorting.locale.modalDialogCaptionButtonDesc,modalDialogCaptionButtonAsc:$.ig.GridSorting.locale.modalDialogCaptionButtonAsc,modalDialogCaptionButtonUnsort:$.ig.GridSorting.locale.modalDialogCaptionButtonUnsort,modalDialogWidth:350,modalDialogHeight:"",modalDialogAnimationDuration:200,featureChooserText:$.ig.GridSorting.locale.featureChooserText,unsortedColumnTooltip:$.ig.GridSorting.locale.unsortedColumnTooltip,columnSettings:[{columnKey:null,columnIndex:null,firstSortDirection:null,currentSortDirection:null,allowSorting:true}],modalDialogCaptionText:$.ig.GridSorting.locale.modalDialogCaptionText,modalDialogButtonApplyText:$.ig.GridSorting.locale.modalDialogButtonApplyText,modalDialogButtonCancelText:$.ig.GridSorting.locale.modalDialogButtonCancelText,featureChooserSortAsc:$.ig.GridSorting.locale.featureChooserSortAsc,featureChooserSortDesc:$.ig.GridSorting.locale.featureChooserSortDesc,persist:true,sortingDialogContainment:"owner",inherit:false},renderInFeatureChooser:true,events:{columnSorting:"columnSorting",columnSorted:"columnSorted",modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",modalDialogSortingChanged:"modalDialogSortingChanged",modalDialogButtonUnsortClick:"modalDialogButtonUnsortClick",modalDialogSortClick:"modalDialogSortClick",modalDialogButtonApplyClick:"modalDialogButtonApplyClick",modalDialogButtonResetClick:"modalDialogButtonResetClick"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var self=this;this._headers=[];this._clickHandler=function(event){var th,id,scrLeft,$scrContainer;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}th=$(event.currentTarget).closest("th");if(th.attr("data-skip")!=="true"&&(self.grid._isMultiColumnGrid!==true||th.attr("data-isheadercell")==="true")){if(!self._checkSortingAllowed(th.data("columnIndex"))){return}self._handleSort(event);scrLeft=$("#"+self.grid.id()+"_hscroller").scrollLeft();if(scrLeft>0){if(self.grid.options.fixedHeaders===true){self.grid.headersTable().parent().scrollLeft(scrLeft)}if(self.grid.options.fixedFooters===true){self.grid.footersTable().parent().scrollLeft(scrLeft)}$scrContainer=self.grid.scrollContainer();if(!$scrContainer.length){$scrContainer=self.grid._vdisplaycontainer()}$scrContainer.scrollLeft(scrLeft)}}};this._dragStartHandler=function(event){var id,noCancel=true;noCancel=self.grid._trigger("headercelldragcancel",event,{});if(noCancel){id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}event.stopPropagation();event.preventDefault()}else{return true}return false};this._mouseOverHandler=function(event){var id,$target=$(event.currentTarget),cs;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}cs=self._getColSettingFromElement(event.currentTarget);if(cs&&cs.allowSorting!==false){$target.addClass(self.css.sortableColumnHeaderHover)}};this._mouseOutHandler=function(event){var id;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}$(event.currentTarget).removeClass(self.css.sortableColumnHeaderHover)};$("#"+this.element[0].id).delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id+" thead th").bind("dragstart",this._dragStartHandler);$("#"+this.element[0].id+"_headers thead th").bind("dragstart",this._dragStartHandler);$(document).delegate("#"+this.element[0].id+"_headers thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});this._keyDownHandler=function(event){self._handleSortKb(event)};this._focusHandler=function(event){self._handleFocusKb(event)};this._blurHandler=function(event){self._handleBlurKb(event)};$("#"+this.element[0].id).delegate("thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).delegate("#"+this.element[0].id+"_headers thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler})},_setOption:function(key,value){var i,col,featureChooserInstance,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"type":throw new Error($.ig.Grid.locale.optionChangeNotSupported.replace("{optionName}",key));case"caseSensitive":this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;break;case"modalDialogSortOnClick":modalDialog.remove();this._renderMultipleSortingDialog();break;case"modalDialogAnimationDuration":modalDialog.igGridModalDialog("option","animationDuration",value);break;case"modalDialogWidth":modalDialog.igGridModalDialog("option","modalDialogWidth",value);break;case"modalDialogHeight":modalDialog.igGridModalDialog("option","modalDialogHeight",value);break;case"modalDialogButtonApplyText":modalDialog.igGridModalDialog("option","buttonApplyText",value);break;case"modalDialogButtonCancelText":modalDialog.igGridModalDialog("option","buttonCancelText",value);break;case"modalDialogCaptionText":modalDialog.igGridModalDialog("option","modalDialogCaptionText",value);break;case"featureChooserText":featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(featureChooserInstance){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i].key;featureChooserInstance._setListItemText(col,"Sorting",value)}}break;default:break}},_getColSettingFromElement:function(e){var index,cs=this.options.columnSettings,$e=$(e);index=parseInt($e.data("columnIndex"),10);return cs[index]},_handleSortKb:function(event){if($(event.target).attr("id")===undefined||$(event.target).attr("id")===null){return}var $el=$(event.target),key=$el.attr("id").replace(this.grid.element.attr("id")+"_",""),id;id=$el.closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(this._checkSortingAllowed($el.data("columnIndex"))){if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}$el.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$el;if(event.shiftKey){this.unsortColumn(key,$el)}else{this.sortColumn(key,null,$el)}}event.stopPropagation();event.preventDefault()}},_handleFocusKb:function(event){if(this._resizing&&this._resizing._resizing){return}var $target=$(event.target),id=$target.closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id||$target.attr("data-fixing-indicator")!==undefined||!this._checkSortingAllowed($target.data("columnIndex"))){return}$target.addClass(this.css.sortableColumnHeaderFocus)},_handleBlurKb:function(event){var id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}$(event.target).removeClass(this.css.sortableColumnHeaderFocus)},_handleSort:function(event){if(this._resizing&&this._resizing._resizing){this._resizing._resizing=false;return}var $currentTarget=$(event.currentTarget),$th=$currentTarget.closest("th"),key=$th.attr("id").replace(this.grid.element.attr("id")+"_",""),isShiftClicked=false;if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderFocus)}isShiftClicked=event.shiftKey;if(isShiftClicked){$th.removeClass(this.css.sortableColumnHeaderFocus).removeClass(this.css.sortableColumnHeaderActive);this._currentHeader=$th;this.unsortColumn(key,$th)}else{$currentTarget.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$th;this.sortColumn(key,null,$currentTarget)}event.stopPropagation();event.preventDefault()},_checkSortingAllowed:function(index){var s,colKey,col=this.grid.options.columns[index];if(!col){return false}colKey=col.key;if(col.hidden){return true}s=this._findColumnSetting(colKey);if(s===null||s===undefined||s&&s.allowSorting===false){return false}return true},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading").indicator():this.grid.element.igLoading().data("igLoading").indicator()},_getHeaderCellByIdentifier:function(identifier){var $headerCell,colKey;if($.type(identifier)==="number"){colKey=this.grid.options.columns[identifier].key}else{colKey=identifier}$headerCell=$("#"+this.grid.element[0].id+"_"+colKey);return $headerCell},sortColumn:function(index,direction,header){var colKey,expr,noCancel=true,s,se,i,visualIndex,groupby,reset=true,newDir,apiCall=header===null||header===undefined,addSE=false,isHidden=false,sortingNewExprs,curNewExpr;this._activeSortedCol=null;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key;if(this.grid.options.columns[index].hidden){isHidden=true}}else{colKey=index;if(header===null||header===undefined){header=$("#"+this.grid.element[0].id+"_"+colKey)}index=header.data("columnIndex");if(index===undefined){isHidden=true}}this._curColKey=colKey;expr=this.grid.dataSource.settings.sorting.expressions;s=this._findColumnSetting(colKey);if(this.grid.options.virtualizationMode==="fixed"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){visualIndex=index-this.grid._startColIndex}else{visualIndex=index}if(apiCall&&this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}if(header===null||header===undefined){visualIndex+=this.grid.headersTable().children("thead").children("tr").children("th[data-skip=true]").length;if(colKey){header=$("#"+this.grid.element[0].id+"_"+colKey)}else{header=this.grid.headersTable().children("thead").children("tr").children("th:nth-child("+(visualIndex+1)+")")}apiCall=true}if(s&&s.allowSorting===false){return}if(direction!==null&&direction!==undefined){newDir=direction}else{if(s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&!s.currentSortDirection.startsWith("asc")&&!s.currentSortDirection.startsWith("desc")||s.currentSortDirection===undefined||s.currentSortDirection===null){newDir=s.firstSortDirection===undefined?this.options.firstSortDirection:s.firstSortDirection}else{newDir=s.currentSortDirection!==undefined&&s.currentSortDirection!==null&&s.currentSortDirection.indexOf("asc")!==-1?"descending":"ascending"}}this._trigger("internalcolumnsorting",null,{owner:this});for(i=0;this.grid.options.features&&i<this.grid.options.features.length;i++){if(this.grid.options.features[i]&&this.grid.options.features[i].name==="GroupBy"){groupby=this.grid.element.data("igGridGroupBy");if(groupby&&groupby.options.groupedColumns&&groupby.options.groupedColumns.length>0){reset=false}}}curNewExpr={fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"};if(this.options.mode==="single"){if(reset){sortingNewExprs=[{fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"}]}else{sortingNewExprs=[];se=this.grid.dataSource.settings.sorting.expressions;addSE=true;for(i=0;i<se.length;i++){if(se[i].isGroupBy===true){if(se[i].fieldName===colKey){addSE=false}sortingNewExprs.push(se[i])}}if(addSE){sortingNewExprs.push({fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"})}}}else{sortingNewExprs=expr.slice();for(i=0;i<expr.length;i++){if(sortingNewExprs[i].fieldName===colKey){sortingNewExprs.splice(i,1);break}}sortingNewExprs=sortingNewExprs.concat([{fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc"}])}if(!apiCall){noCancel=this._trigger(this.events.columnSorting,null,{columnKey:colKey,direction:newDir,owner:this,newExpressions:sortingNewExprs})}if(noCancel){s.currentSortDirection=curNewExpr.dir.startsWith("asc")?"ascending":"descending";this._loadingIndicator.show();header.attr("title",s.currentSortDirection.startsWith("asc")?this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.ascending):this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.descending));if(this.options.mode==="single"){if(isHidden){this._clearSortStates(header,-1);for(i=0;i<this.grid.options.columns.length;i++){if(this.options.columnSettings[i]&&this.options.columnSettings[i].allowSorting!==false&&this.options.columnSettings[i].columnKey!==colKey){this._clearSortState(header,this.options.columnSettings[i].columnIndex,this.options.columnSettings[i].columnKey)}}}else{this._clearSortStatesByKey(header,colKey)}if(isHidden&&direction!==null&&direction!==undefined){s.currentSortDirection=direction}}this.grid.dataSource.settings.sorting.expressions=sortingNewExprs;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}if(noCancel){this._saveSortingExpressions();this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._currentHeader=header;this._curColKey=colKey;if(this.options.type==="remote"){if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions,s.currentSortDirection);this.grid._renderData();if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions})}}this._curSortDir=s.currentSortDirection}}},sortMultiple:function(){var self=this,exprLen,id=self.grid.element[0].id,noCancel,expr=this.grid.dataSource.settings.sorting.expressions;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){this._currentHeader=null;this._curColKey=null;if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive)}exprLen=expr&&expr.length;if(!exprLen){exprLen=0}$.each(this.grid.options.columns,function(index,column){var i,cs,colKey=column.key,header=$("#"+id+"_"+colKey);for(i=0;i<exprLen;i++){if(expr[i].fieldName===colKey){if(i===exprLen-1){self._currentHeader=header;self._curColKey=colKey}break}}cs=self._findColumnSetting(colKey);if(cs){if(i===exprLen){cs.currentSortDirection=undefined;if(cs.allowSorting!==false){self._clearSortState(header,cs.columnIndex,colKey)}}else{cs.currentSortDirection=expr[i].dir;self._applySortStyles(header,colKey)}}});this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this._isResetClick===true){this._isResetClick=false}this._saveSortingExpressions();if(this.options.type==="remote"){this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._renderData()}}},clearSorting:function(){var i,se=[],exprs=this.grid.dataSource.settings.sorting.expressions;for(i=0;i<exprs.length;i++){se.push(exprs[i].fieldName)}for(i=0;i<se.length;i++){this.unsortColumn(se[i],undefined)}},unsortColumn:function(index,header){var colKey,expr,noCancel=true,s,i,exprLen,apiCall=header===null||header===undefined;this._activeSortedCol=null;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key}else{colKey=index}expr=this.grid.dataSource.settings.sorting.expressions;s=this._findColumnSetting(colKey);if(s===null||s===undefined){return}if(s&&s.allowSorting===false){return}s.currentSortDirection=undefined;if(s.userSet_currentSortDirection){delete s.userSet_currentSortDirection}exprLen=expr.length;for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1);break}}if(i===exprLen){return}this._curColKey=null;this._currentHeader=null;this._applySortStyles($("#"+this.grid.element[0].id+"_"+colKey),index);if(!apiCall&&!(this.grid.dataSource.settings.sorting.expressions.length===0&&this.options.type==="local")){noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource})}if(noCancel){this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._curColKey=colKey;this._currentHeader=header;if(this.options.type==="remote"){if(!this._loadingIndicator){this._initLoadingIndicator()}this._loadingIndicator.show();if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{if(this.grid.dataSource.settings.sorting.expressions.length===0&&exprLen>0){this.grid.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._renderData()}if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions})}}this._curSortDir=s.currentSortDirection;this._saveSortingExpressions()}},_excludeExpr:function(key){if(this.options.persist&&!this._couldPreserveData()){return}var expr=this.grid.dataSource.settings.sorting.expressions,i;for(i=0;i<expr.length;i++){if(expr[i].fieldName===key){$.ig.removeFromArray(expr,i)}}},_applySortStyles:function(header,columnKey,ignoreActiveSelection){var oldHeight=null,span,col,indicatorContainer,indexResolved,i,currentColumnSetting,toolTip=this.options.sortedColumnTooltip,hasFixedColumns=this.grid.hasFixedColumns(),sortAsc=toolTip.replace("${direction}",$.ig.GridSorting.locale.ascending),sortDesc=toolTip.replace("${direction}",$.ig.GridSorting.locale.descending);if(this.grid.options.fixedHeaders){oldHeight=this.grid.headersTable().outerHeight()}span=header.find(".ui-iggrid-colindicator");if(span.length===0){span=$("<span></span>").addClass(this.css.sortIndicator)}indicatorContainer=header.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").appendTo(header).addClass("ui-iggrid-indicatorcontainer")}indicatorContainer.append(span);indexResolved=this.grid.getVisibleIndexByKey(columnKey,true)+1;if(columnKey!==null&&columnKey!==undefined){for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===columnKey){currentColumnSetting=this.options.columnSettings[i];break}}}if(hasFixedColumns&&this.grid._isFixedElement(header)){col=$("#"+this.element[0].id+"_fixed tbody tr td:nth-child("+indexResolved+")")}else{if(this.grid.options.fixedHeaders!==true){col=header.closest("thead").parent().find("tbody tr:not([data-grouprow]) td:nth-child("+indexResolved+")")}else if(this.options.applySortedColumnCss!==false){col=this.grid.element.find("tr:not([data-grouprow]) td:nth-child("+indexResolved+")")}}this._activeSortedCol=null;if(currentColumnSetting!==undefined&&currentColumnSetting.currentSortDirection!==undefined){if(currentColumnSetting.currentSortDirection.indexOf("asc")!==-1){span.removeClass(this.css.sortIndicatorDescending).addClass(this.css.sortIndicatorAscending);header.removeClass(this.css.descendingColumnHeader).addClass(this.css.ascendingColumnHeader);header.attr("title",sortAsc);header.attr("aria-sort","ascending");header.siblings("th").removeAttr("aria-sort");if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){this._activeSortedCol={key:currentColumnSetting.columnKey,asc:true};col.removeClass(this.css.descendingColumn).addClass(this.css.ascendingColumn)}}else{span.removeClass(this.css.sortIndicatorAscending).addClass(this.css.sortIndicatorDescending);header.removeClass(this.css.ascendingColumnHeader).addClass(this.css.descendingColumnHeader);header.attr("title",sortDesc);header.attr("aria-sort","descending");header.siblings("th").removeAttr("aria-sort");if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){this._activeSortedCol={key:currentColumnSetting.columnKey,asc:false};col.removeClass(this.css.ascendingColumn).addClass(this.css.descendingColumn)}}}else{header.attr("title",this.options.unsortedColumnTooltip);header.removeAttr("aria-sort");if(this.grid._isMultiColumnGrid===true){span=header.find(".ui-iggrid-colindicator")}else{span=header.parent("tr").find("th:nth-child("+indexResolved+") .ui-iggrid-colindicator")}span.removeClass(this.css.sortIndicatorAscending).removeClass(this.css.descendingColumnHeader);header.removeClass(this.css.ascendingColumnHeader).removeClass(this.css.descendingColumnHeader)}if(oldHeight!==null&&oldHeight!==this.grid.headersTable().outerHeight()){this.grid._initializeHeights()}},_clearSortStatesByKey:function(header,key){var i,cs=this.options.columnSettings,csLen=cs.length,clearHiddenCols=this.options.mode==="single"&&this.grid._detachedHeaderCells;for(i=0;i<csLen;i++){if(cs[i].allowSorting===false||cs[i].columnKey===key){continue}delete cs[i].currentSortDirection;this._clearSortState(header,cs[i].columnIndex,cs[i].columnKey);if(clearHiddenCols&&cs[i].columnKey&&this.grid._detachedHeaderCells[cs[i].columnKey]){this._clearHeaderCellSortState(this.grid._detachedHeaderCells[cs[i].columnKey][0])}}},_clearSortStates:function(header,index){var i,cs=this.options.columnSettings,realIndex=index,isSingleMode=this.options.mode==="single";for(i=0;i<this.grid.options.columns.length;i++){if(i<index&&this.grid.options.columns[i].hidden){realIndex--}}index=realIndex;for(i=0;i<this.options.columnSettings.length;i++){if(cs[i].allowSorting!==false){if(index!==undefined&&cs[i].columnIndex!==index){delete cs[i].currentSortDirection;this._clearSortState(header,cs[i].columnIndex,cs[i].columnKey)}if(this.grid._detachedHeaderCells&&isSingleMode&&cs[i].columnKey&&this.grid._detachedHeaderCells[cs[i].columnKey]){if(cs[i].currentSortDirection!==undefined&&cs[i].currentSortDirection!==null){delete cs[i].currentSortDirection}this._clearHeaderCellSortState(this.grid._detachedHeaderCells[cs[i].columnKey][0])}}}},_clearSortStateFixing:function(columnKey){var th,id=this.grid.element.attr("id")+"_"+columnKey,visibleIndex=this._columnFixing._getVisibleIndex(columnKey);th=$("#"+id);this._clearSortStateByVisibleIndex(visibleIndex,th)},_clearSortState:function(header,i,columnKey){if(this.grid.hasFixedColumns()&&columnKey!==undefined){this._clearSortStateFixing(columnKey);return}var th,ths,fixedColumnsLength;if(this.grid._isMultiColumnGrid===true){ths=this.grid._headerCells;th=ths[i];if(th===undefined){return}}else{if(this.grid.hasFixedColumns()){fixedColumnsLength=this.grid._fixedColumns.length;if(i<fixedColumnsLength){ths=this.grid.fixedHeadersTable().find("thead > tr").first().find("th").not("[data-skip=true]")}else{ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]");i-=fixedColumnsLength}th=ths.eq(i)}else{ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]");th=ths.eq(i)}}this._clearSortStateByVisibleIndex(i,th)},_clearSortStateByVisibleIndex:function(i,th){var spanHeader=th,col;this._clearHeaderCellSortState(spanHeader);if(this.options.columnSettings.length>i&&this.options.columnSettings[i].allowSorting){th.attr("title",this.options.unsortedColumnTooltip)}else{th.attr("title","")}if(this.options.applySortedColumnCss!==false){if(this.grid.options.fixedHeaders!==true){col=th.closest("thead").parent().find("tbody tr td:nth-child("+(i+1)+")")}else{col=this.grid.element.find("tr td:nth-child("+(i+1)+")")}col.removeClass(this.css.descendingColumn).removeClass(this.css.ascendingColumn)}},_clearHeaderCellSortState:function(spanHeader){var span=spanHeader.find(".ui-iggrid-colindicator");if(span.hasClass("ui-iggrid-colindicator-desc")||span.hasClass("ui-iggrid-colindicator-asc")){span.removeClass(this.css.sortIndicatorDescending).removeClass(this.css.sortIndicatorAscending);spanHeader.removeClass(this.css.ascendingColumnHeader).removeClass(this.css.descendingColumnHeader).removeClass(this.css.sortableColumnHeaderFocus)}},_initDefaultSettings:function(suppressUsrOpts){var settings=[],key,cs=this.options.columnSettings,i,j,k,colIndex=0,defaultExpressions=[],defExpLength,isToSkipGroupBySortingExpr=false,dir,allowSorting,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";if(this.grid.dataSource.settings.sorting.expressions!==null&&this.grid.dataSource.settings.sorting.expressions!==undefined){defaultExpressions=this.grid.dataSource.settings.sorting.expressions}defExpLength=defaultExpressions.length;if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){allowSorting=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(this.grid.options.columns[i].key)!==null){allowSorting=false}settings[i]={columnIndex:colIndex,columnKey:this.grid.options.columns[i].key,allowSorting:allowSorting};if(this.grid.options.columns[i].hidden!==true){colIndex++}}}for(i=0;i<cs.length;i++){for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"){if(key==="userSet_currentSortDirection"){if(cs[i].userSet_currentSortDirection==="undefined"||cs[i].userSet_currentSortDirection===undefined){delete cs[i].currentSortDirection}else{cs[i].currentSortDirection=cs[i].userSet_currentSortDirection}}else if(key==="userSet_allowSorting"){cs[i].allowSorting=cs[i][key];delete cs[i][key]}}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey||typeof cs[i].currentSortDirection!=="string"){continue}dir=cs[i].currentSortDirection.startsWith("asc")?"asc":"desc";defaultExpressions.push({fieldName:cs[i].columnKey,isSorting:true,dir:dir})}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey!==null&&settings[j].columnKey!==undefined&&cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(settings[j].columnKey===cs[i].columnKey){break}}else if(settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"&&!key.startsWith("userSet")){settings[j][key]=cs[i][key];if(!suppressUsrOpts){settings[j]["userSet_"+key]=cs[i][key]}if(key==="currentSortDirection"&&cs[i][key]){if($.type(settings[j].columnKey)!=="number"){isToSkipGroupBySortingExpr=false;if(defExpLength>0){for(k=0;k<defExpLength;k++){if(defaultExpressions[k].fieldName===settings[j].columnKey){if(defaultExpressions[k].isGroupBy===true){isToSkipGroupBySortingExpr=true}else{defaultExpressions.splice(k,1)}break}}}if(isToSkipGroupBySortingExpr===true){continue}defaultExpressions.push({fieldName:settings[j].columnKey,isSorting:true,dir:cs[i][key].startsWith("asc")?"asc":"desc"})}else{defaultExpressions.push({fieldIndex:settings[j].columnKey,isSorting:true,dir:cs[i][key].startsWith("asc")?"asc":"desc"})}}}}}}for(i=0;i<settings.length;i++){if(!settings[i].hasOwnProperty("currentSortDirection")){settings[i].userSet_currentSortDirection="undefined"}for(j=0;j<this.grid.dataSource.settings.sorting.expressions.length;j++){if(this.grid.dataSource.settings.sorting.expressions[j].fieldName===settings[i].columnKey){settings[i].currentSortDirection=this.grid.dataSource.settings.sorting.expressions[j].dir}}}this.options.columnSettings=settings;this.grid.dataSource.settings.sorting.expressions=defaultExpressions;this.grid.dataSource.settings.sorting.defaultFields=defaultExpressions},_headerCellRendered:function(event,ui){var cs=this._findColumnSetting(ui.columnKey),i,col,initialSorting,featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(event.target.id!==this.grid.element[0].id){return}if(ui.isMultiColumnHeader===true){return}if(ui.columnKey&&cs){this._headers.push({header:ui.th,index:cs.columnIndex});if(cs.allowSorting!==false){ui.th.addClass(this.css.sortableColumnHeader);if(cs.currentSortDirection===undefined||cs.currentSortDirection===null){ui.th.attr("title",this.options.unsortedColumnTooltip)}else{ui.th.attr("title",cs.currentSortDirection.startsWith("asc")?this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.ascending):this.options.sortedColumnTooltip.replace("${direction}",$.ig.GridSorting.locale.descending))}$("<span></span>").appendTo(ui.th).addClass(this.css.sortIndicator);if(cs.currentSortDirection!==undefined){this._applySortStyles(ui.th,cs.columnKey)}}}if(!this._featureChooserInitialized&&featureChooserInstance&&this.renderInFeatureChooser){this._featureChooserInitialized=true;if(this._featureChooserMenuTogglingHandler){this.grid.element.unbind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler)}this._featureChooserMenuTogglingHandler=$.proxy(this._featureChooserMenuToggling,this);this.grid.element.bind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler);if(featureChooserInstance._isTouchDevice()){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];cs=this._getColumnSettingsByIndex(i);if(cs.allowSorting){if(featureChooserInstance&&featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){initialSorting=cs.currentSortDirection;if(initialSorting===null){initialSorting=false}featureChooserInstance._renderInFeatureChooser(col.key,{name:"SortingAscending",text:this.options.featureChooserSortAsc,textHide:this.options.featureChooserSortAsc,iconClass:this.css.fcSortIndicatorAscending,iconClassOff:this.css.fcSortIndicatorAscending,isSelected:initialSorting&&typeof initialSorting==="string"?initialSorting.toLowerCase().indexOf("asc")>-1:false,method:$.proxy(this._sortAscFromFeatureChooser,this),updateOnClickAll:false,groupName:"toggle",groupOrder:1,order:0,type:"toggle"});
featureChooserInstance._renderInFeatureChooser(col.key,{name:"SortingDescending",text:this.options.featureChooserSortDesc,textHide:this.options.featureChooserSortDesc,iconClass:this.css.fcSortIndicatorDescending,iconClassOff:this.css.fcSortIndicatorDescending,isSelected:initialSorting&&typeof initialSorting==="string"?initialSorting.toLowerCase().indexOf("desc")>-1:false,method:$.proxy(this._sortDescFromFeatureChooser,this),updateOnClickAll:false,groupName:"toggle",groupOrder:1,order:0,type:"toggle"})}}}}if(this.options.mode!=="single"){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(this._getColumnSettingsByIndex(i).allowSorting){if(featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){featureChooserInstance._renderInFeatureChooser(col.key,{name:"MultipleSorting",text:this.options.featureChooserText,iconClass:this.css.featureChooserModalDialogIcon,method:$.proxy(this.openMultipleSortingDialog,this),groupName:"modaldialog",groupOrder:3,order:2})}}}}}},_featureChooserMenuToggling:function(event,args){var i,expr,isAsc,hasSorting=false,columnKey=args.columnKey,featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),exprs=this.grid.dataSource.settings.sorting.expressions,exprsLength=exprs.length;if(!args.isVisible){for(i=0;i<exprsLength;i++){expr=exprs[i];if(expr.fieldName===columnKey){hasSorting=true;isAsc=false;if(expr.dir&&expr.dir.toLowerCase().indexOf("asc")>-1){isAsc=true}featureChooserInstance._setSelectedState("SortingDescending",columnKey,!isAsc,false);featureChooserInstance._setSelectedState("SortingAscending",columnKey,isAsc,false)}}if(!hasSorting){featureChooserInstance._setSelectedState("SortingDescending",columnKey,false,false);featureChooserInstance._setSelectedState("SortingAscending",columnKey,false,false)}}},_sortAscFromFeatureChooser:function(event,columnKey,isSelected){var featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),gridId=this.grid.id(),$th=$("#"+gridId+"_"+columnKey);if(!featureChooserInstance){return}featureChooserInstance._setSelectedState("SortingDescending",columnKey,false,false);if(isSelected){this.sortColumn(columnKey,"asc",$th)}else{this.unsortColumn(columnKey,$th)}},_sortDescFromFeatureChooser:function(event,columnKey,isSelected){var featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),gridId=this.grid.id(),$th=$("#"+gridId+"_"+columnKey);featureChooserInstance._setSelectedState("SortingAscending",columnKey,false,false);if(!featureChooserInstance){return}if(isSelected){this.sortColumn(columnKey,"desc",$th)}else{this.unsortColumn(columnKey,$th)}},_columnFixed:function(args){var i,colInd=args.colInd,cs,fixedTable=this.grid.fixedHeadersTable(),at=args.at,isAttachedSortingHandlers=false,fixedColumnsLength=args.fixedColsCount;isAttachedSortingHandlers=fixedTable.data("attachedSortingHandlers");if(isAttachedSortingHandlers!==true){fixedTable.data("attachedSortingHandlers",true);fixedTable.delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler})}cs=this.options.columnSettings[colInd];if(cs){if(at===undefined){at=fixedColumnsLength-1}this.options.columnSettings.splice(colInd,1);this.options.columnSettings.splice(at,0,cs)}for(i=0;i<this.options.columnSettings.length;i++){this.options.columnSettings[i].columnIndex=i}},_columnsRearranged:function(){this._initDefaultSettings(true)},_columnMap:function(){var self=this,isMultiple=self.options.mode!=="single";return $.map(this.grid.options.columns,function(col,index){var allowSorting=false;if(isMultiple&&self._getColumnSettingsByIndex(index).allowSorting){allowSorting=true}return{columnKey:col.key,enabled:allowSorting}})},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_dataRendered:function(){var i,cs,expr,col,colKey,gridId=this.grid.element[0].id,ignoreActiveSelection;if(!this._loadingIndicator){this._initLoadingIndicator()}expr=this._sortingExpressions;if(this._shouldFireColumnSorted){this._trigger(this.events.columnSorted,null,{columnKey:this._curColKey,direction:this._curSortDir,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions});this._shouldFireColumnSorted=false}this._loadingIndicator.hide();if(this._curColKey!==undefined&&this._curColKey!==null&&this._currentHeader!==undefined&&this._currentHeader!==null){this._applySortStyles(this._currentHeader,this._curColKey)}else if(this.options.persist&&this._restoreSorting&&expr&&expr.length>0){for(i=0;i<expr.length;i++){if(expr[i].isGroupBy){continue}colKey=expr[i].fieldName;cs=this._findColumnSetting(colKey);if(cs){cs.currentSortDirection=expr[i].dir}ignoreActiveSelection=true;col=$("#"+gridId+"_"+colKey);if(i===expr.length-1){col.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=col;ignoreActiveSelection=false;this._curColKey=colKey}this._applySortStyles(col,colKey,ignoreActiveSelection)}this._restoreSorting=false}if(this._hc===undefined){this._hc=this.grid.container().find(".ui-iggrid-expandheadercell").length>0}if((this.grid.options.rowVirtualization||this.grid.options.virtualization)&&!this.grid._persistVirtualScrollTop){$("#"+this.grid.element.attr("id")+"_scrollContainer").scrollTop(0)}},_onUIDirty:function(e,args){if(this.options.persist&&this.options.type==="remote"){return}var i,j,exprs=this.grid.dataSource.settings.sorting.expressions,defaultExprs=this.grid.dataSource.settings.sorting.defaultFields,cs=this.options.columnSettings,skip=false;if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}this._curColKey=null;this._currentHeader=null;this._clearUi(true);for(i=0;i<exprs.length;i++){skip=false;for(j=0;j<cs.length;j++){if(cs[j].columnKey===exprs[i].fieldName&&cs[j].userSet_currentSortDirection){skip=true;break}}if(!skip){if(exprs.length>i){$.ig.removeFromArray(exprs,i)}if(defaultExprs.length>i){$.ig.removeFromArray(defaultExprs,i)}}}},_clearUi:function(){var i,header,csd,isMCH=this.grid._isMultiColumnGrid,persist=this.options.persist;for(i=0;this._headers&&i<this._headers.length;i++){csd=this.options.columnSettings[i].userSet_currentSortDirection;if((isMCH||persist)&&this.options.columnSettings[i].columnKey){header=$("#"+this.grid.element[0].id+"_"+this.options.columnSettings[i].columnKey)}else{header=this._headers[i].header}if(csd===undefined||csd===null||csd==="undefined"){this._clearSortState(header,i,this.options.columnSettings[i].columnKey);if(this.options.mode!=="single"){delete this.options.columnSettings[i].currentSortDirection;this._excludeExpr(this.options.columnSettings[i].columnKey)}}else{this._applySortStyles(header,this.options.columnSettings[i].columnKey)}header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).addClass(this.grid.css.headerClass);if(this.options.columnSettings[i].allowSorting){header.addClass(this.css.sortableColumnHeader)}}},_virtualHorizontalScroll:function(event,args){var start=args.startColIndex,end=args.endColIndex,i,j,cs=this.options.columnSettings,header,ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[data-skip=true]"),visibleColumns=this.grid._visibleColumns();for(i=0;i<ths.length;i++){header=ths.eq(i);this._clearSortState(header,i);header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).addClass(this.grid.css.headerClass).addClass(this.css.sortableColumnHeader)}for(i=start;i<=end;i++){header=ths.eq(i-start);header.data("columnIndex",i);for(j=0;j<cs.length;j++){if(cs[j].currentSortDirection&&cs[j].columnKey===visibleColumns[i].key){this._applySortStyles(header,cs[j].columnKey)}}}},_columnsCollectionModified:function(event,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,j,found,colKey,cs,col;for(i=0;i<this.options.columnSettings.length;i++){j=0;found=false;for(j=0;j<this.grid._visibleColumns().length;j++){if(this.grid._visibleColumns()[j].key===this.options.columnSettings[i].columnKey){found=true;colKey=this.grid._visibleColumns()[j].key;break}}if(found){this.options.columnSettings[i].columnIndex=j;cs=this._findColumnSetting(colKey);if(cs&&cs.currentSortDirection!==undefined&&this.options.applySortedColumnCss!==false){col=$("#"+this.grid.element[0].id+"_"+colKey);this._applySortStyles(col,colKey,true)}}}if(this._curColKey){col=$("#"+this.grid.element[0].id+"_"+this._curColKey);this._applySortStyles(col,this._curColKey)}$("#"+this.element[0].id+" thead th").removeClass(this.css.sortableColumnHeaderHover)},_detachEvents:function(){if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._uiDirtyHandler){this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler)}if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(this._columnsRearangedHandler){this.grid.element.unbind("iggrid_columnsmoved",this._columnsRearangedHandler)}if(this._featureChooserMenuTogglingHandler){this.grid.element.unbind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler)}},destroy:function(){var i,a,fc,header,span,text,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");if(!this.grid){return}$("#"+this.element[0].id+" thead th").unbind("dragstart",this._dragStartHandler);$("#"+this.element[0].id+"_headers thead th").unbind("dragstart",this._dragStartHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id).undelegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id).undelegate("thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).undelegate("#"+this.element[0].id+"_headers thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});this._detachEvents();delete this._blurHandler;delete this._clickHandler;delete this._headerCellRenderedHandler;delete this._focusHandler;delete this._keyDownHandler;delete this._mouseOutHandler;delete this._mouseOverHandler;delete this._dragStartHandler;delete this._uiDirtyHandler;delete this._virtualHorizontalScrollHandler;delete this._headerRenderedHandler;delete this._columnsRearangedHandler;this.grid.element.find(".ui-iggrid-colasc").removeClass("ui-iggrid-colasc ui-state-highlight");this.grid.element.find(".ui-iggrid-coldesc").removeClass("ui-iggrid-coldesc ui-state-highlight");this._clearUi(true);for(i=0;this._headers&&i<this._headers.length;i++){header=this._headers[i].header;header.removeClass("ui-iggrid-sortableheader ui-state-default ui-state-active ui-state-hover ui-state-focus");header.attr("title","");span=header.find("a span");text=span.text();a=header.find("a:not([th-remove-focus])");$("<span>"+text+"</span>").appendTo(header).addClass("ui-iggrid-headertext");a.remove()}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("SortingAscending");fc._removeFeature("SortingDescending");fc._removeFeature("MultipleSorting")}this._headers=null;if(this._loadingIndicator){delete this._loadingIndicator}modalDialog.igGridModalDialog("getCaptionButtonContainer");modalDialog.remove();$.Widget.prototype.destroy.apply(this,arguments);return this},_renderMultipleSortingDialog:function(){var $buttonOK,containment,self=this,o=this.options,modalDialogId=this.grid.element[0].id+"_multiplesorting_modalDialog",$captionButtonContainer,modalDialog;if(this.options.sortingDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}$("#"+modalDialogId).remove();modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",modalDialogId);modalDialog.igGridModalDialog({containment:containment,buttonApplyText:o.modalDialogButtonApplyText,buttonCancelText:o.modalDialogButtonCancelText,renderFooterButtons:!o.modalDialogSortOnClick,modalDialogCaptionText:o.modalDialogCaptionText,modalDialogWidth:o.modalDialogWidth,modalDialogHeight:o.modalDialogHeight,animationDuration:o.modalDialogAnimationDuration,gridContainer:this.grid.container(),modalDialogOpening:function(event,args){var noCancel=self._trigger(self.events.modalDialogOpening,null,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._multiplesortingDialogOpening(event,args);self._trigger(self.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:self})}return noCancel},modalDialogMoving:function(e,ui){self._trigger(self.events.modalDialogMoving,null,{modalDialogElement:e.target,owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(){self._trigger(self.events.modalDialogClosed,null,{modalDialogElement:modalDialog,owner:self})}});if(o.modalDialogSortOnClick){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$("<span></span>").bind("click.hiding",function(event){modalDialog.igGridModalDialog("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}).addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",$.ig.GridHiding.locale.columnChooserCloseButtonTooltip).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all"))}else{$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$buttonOK=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._multiplesortingDialogButtonOKClick(e);e.preventDefault()})}},openMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog.igGridModalDialog("openModalDialog")},closeMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog.igGridModalDialog("closeModalDialog")},_multiplesortingDialogOpening:function(){this._tempExpr=this.grid.dataSource.settings.sorting.expressions.slice(0);this.renderMultipleSortingDialogContent(true)},renderMultipleSortingDialogContent:function(isToCallEvents){var $content,$sortedColumns,$unsortedColumns,i,j,noCancel=true,self=this,columns=this.grid.options.columns,css=this.css,se=this.grid.dataSource.settings.sorting.expressions,seLength=se.length,sortedColumns=[],modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");if(isToCallEvents){noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialogElement:modalDialog,owner:this})}if(noCancel){this.removeDialogClearButton();$content=modalDialog.igGridModalDialog("getContent");$content.empty();$sortedColumns=$("<div></div>").attr("id",this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns").addClass(css.dialogSortedColumns).appendTo($content);$unsortedColumns=$("<div></div>").attr("id",this.grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns").addClass(css.dialogUnsortedColumns).appendTo($content);$("<ul></ul>").addClass(css.dialogSortedColumnsList).appendTo($sortedColumns);$("<ul></ul>").addClass(css.dialogUnsortedColumnsList).appendTo($unsortedColumns);$.each(columns,function(columnIndex,column){var cs,columnIdentifier,direction;cs=self._getColumnSettingsByIndex(columnIndex);if(cs===null||cs===undefined||cs.allowSorting===false){return true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;for(i=0;i<self._tempExpr.length;i++){if(self._tempExpr[i].fieldName===columnIdentifier){break}}if(i!==self._tempExpr.length){sortedColumns.push({column:column,columnIndex:cs.columnIndex,dir:self._tempExpr[i].dir,columnIdentifier:columnIdentifier})}else{direction=cs.currentSortDirection||cs.firstSortDirection||self.options.firstSortDirection;self._renderDialogUnsortedColumn(column,cs.columnIndex,direction,columnIdentifier)}});for(i=0;i<seLength;i++){for(j=0;j<sortedColumns.length;j++){if(se[i].fieldName===sortedColumns[j].columnIdentifier){self._renderDialogSortedColumn(sortedColumns[j].column,sortedColumns[j].columnIndex,sortedColumns[j].dir,sortedColumns[j].columnIdentifier);break}}}if(isToCallEvents){this._trigger(this.events.modalDialogContentsRendered,null,{modalDialogElement:modalDialog,owner:this})}if(this._checkRenderButtonReset()){this._renderDialogButtonClearAll()}}},_addSlideButtonSortingColumns:function(){var css=this.css,o=this.options,$sortedColumns=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns"),buttonId=this.grid.element[0].id+"_multiplesorting_modalDialog_slidebutton",$button,innerHTML;innerHTML='<div class="'+css.dialogSlideArea+'">'+'	<div class="'+css.dialogSlideAreaContainer+'">'+'		<button id="'+buttonId+'" class="'+css.dialogButtonSlide+'" role="button" aria-disabled="false" title="'+o.dialogButtonSlideCaption+'">'+'			<span class="'+css.dialogButtonSlideContainer+'"></span>'+'			<span class="ui-button-text">'+o.dialogButtonSlideCaption+"</span>"+"		</button>"+"	</div>"+"</div>";$(innerHTML).insertAfter($sortedColumns);$button=$("#"+buttonId);$button.bind({click:function(){$sortedColumns.slideToggle("slow");$(this).find("span:eq(0)").toggleClass(css.dialogButtonSlideUp);return false}})},_renderDialogSortedColumn:function(column,columnIndex,direction,columnIdentifier){var self=this,$li,css=this.css,$buttonUnsort,liHTML,o=this.options,buttonAscDescId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",buttonUnsortId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonunsort",$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns ul");$ul.css("width");$li=$('<li  tabIndex="0"></li>').attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_sorted_li").addClass(css.dialogSortedColumnsItem);$li.appendTo($ul);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}liHTML='<span id="'+buttonAscDescId+'" class="'+css.dialogButtonAsc+'" role="button" title="'+o.modalDialogCaptionButtonDesc+'" >'+'	<span class="'+css.dialogButtonAscIcon+'"></span>'+"</span>"+'<span class="'+css.dialogSortedColumnTextContainer+'">'+column.headerText+"</span>"+'<button id="'+buttonUnsortId+'" class="'+css.dialogButtonUnsort+'" role="button" title="'+o.modalDialogCaptionButtonUnsort+'" >'+'	<span class="'+css.dialogButtonUnsortContainer+'"></span>'+'	<span class="ui-button-text">'+o.modalDialogCaptionButtonUnsort+"</span>"+"</button>";$li.bind({click:function(e){self._curColKey=columnIdentifier;self._dialogButtonAscDescClick(columnIdentifier);if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}e.preventDefault();e.stopPropagation()}});$li.html(liHTML);$buttonUnsort=$("#"+buttonUnsortId);if(direction!==undefined){if(direction.indexOf("asc")!==-1){self._setDialogButtonAscDesc(true,columnIdentifier);self._setTempExpr(columnIdentifier,"asc")}else{self._setDialogButtonAscDesc(false,columnIdentifier);self._setTempExpr(columnIdentifier,"desc")}}else{self._setDialogButtonAscDesc(true,columnIdentifier);self._setTempExpr(columnIdentifier,"asc")}$buttonUnsort.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){e.target.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,gridId=self.grid.element[0].id,$nextLi,modalDialog=$("#"+gridId+"_multiplesorting_modalDialog");noCancel=self._trigger(self.events.modalDialogButtonUnsortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:columnIdentifier});if(noCancel){$li.remove();if(o.modalDialogSortOnClick===true){self.unsortColumn(columnIdentifier,$("#"+gridId+"_"+columnIdentifier))}else{self._setTempExpr(columnIdentifier)}$nextLi=self._renderDialogUnsortedColumn(column,columnIndex,direction,columnIdentifier);$nextLi.find(":focusable").first().focus(1);if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}e.preventDefault();e.stopPropagation()},mouseover:function(){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}});return $li},_dialogButtonAscDescClick:function(columnIdentifier){var o=this.options,noCancel,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$buttonAscDesc=$("#"+this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc"),isAsc=$buttonAscDesc.data("isAsc");noCancel=this._trigger(this.events.modalDialogSortingChanged,null,{modalDialogElement:modalDialog,owner:this,columnKey:columnIdentifier,isAsc:!isAsc});if(noCancel){if(isAsc===true){if(o.modalDialogSortOnClick===true){this.sortColumn(columnIdentifier,"descending",this._getHeaderCellByIdentifier(columnIdentifier))}else{this._setTempExpr(columnIdentifier,"desc")}this._setDialogButtonAscDesc(false,columnIdentifier)}else{if(o.modalDialogSortOnClick===true){this.sortColumn(columnIdentifier,"ascending",this._getHeaderCellByIdentifier(columnIdentifier))}else{this._setTempExpr(columnIdentifier,"asc")}this._setDialogButtonAscDesc(true,columnIdentifier)}}},_setDialogButtonAscDesc:function(isAsc,columnIdentifier){var css=this.css,buttonAscDescId=this.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",$buttonAscDesc=$("#"+buttonAscDescId),$spanIcon=$buttonAscDesc.find("span:eq(0)");$buttonAscDesc.data("isAsc",isAsc);if(isAsc===true){$buttonAscDesc.attr("title",this.options.modalDialogCaptionButtonDesc).removeClass(css.dialogButtonDesc).addClass(css.dialogButtonAsc);$spanIcon.removeClass(css.dialogButtonDescIcon).addClass(css.dialogButtonAscIcon);this._setTempExpr(columnIdentifier,"asc")}else{$buttonAscDesc.attr("title",this.options.modalDialogCaptionButtonAsc).removeClass(css.dialogButtonAsc).addClass(css.dialogButtonDesc);$spanIcon.removeClass(css.dialogButtonAscIcon).addClass(css.dialogButtonDescIcon);this._setTempExpr(columnIdentifier,"desc")}},_setTempExpr:function(colKey,dir){var i,expr=this._tempExpr;for(i=0;i<expr.length;i++){if(expr[i].fieldName===colKey){expr.splice(i,1);if(dir===null||dir===undefined){this._tempExpr=expr;return}}}this._tempExpr=expr.concat([{fieldName:colKey,isSorting:true,dir:dir}])},_renderDialogUnsortedColumn:function(column,columnIndex,direction,columnIdentifier){var self=this,$li,$a,o=this.options,css=this.css,$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns ul");$ul.css("width");$li=$("<li></li>").attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_multiplesorting_unsorted_li").addClass(css.dialogUnsortedColumnsItem).append('<span class="'+css.dialogUnsortedColumnsSortByButton+'"><a href="#"></a></span> <span class="'+css.dialogItemText+'">'+column.headerText+"</span>");this._insertColumnModalDialog($ul,$li,columnIndex);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}$a=$li.find("a:first");$a.addClass(css.modalDialogSortByColumn);$a.html(o.modalDialogSortByButtonText);$li.bind({keydown:function(e){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$li.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,modalDialog=$("#"+self.grid.element[0].id+"_multiplesorting_modalDialog"),$nextLi;noCancel=self._trigger(self.events.modalDialogSortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:columnIdentifier});if(noCancel){$li.remove();$nextLi=self._renderDialogSortedColumn(column,columnIndex,direction,columnIdentifier);$nextLi.find(":focusable").first().focus(1);if(o.modalDialogSortOnClick){self.sortColumn(columnIdentifier,null,self._getHeaderCellByIdentifier(columnIdentifier))}else{if(self._checkRenderButtonReset()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}}e.preventDefault();e.stopPropagation()}});return $li},_checkRenderButtonReset:function(){var i,j,cs,columnKey,expr=this._tempExpr;this._isResetClick=false;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(cs.allowSorting===false){continue}columnKey=cs.columnKey;for(j=0;j<expr.length;j++){if(expr[j].fieldName===columnKey){if(cs.userSet_currentSortDirection!==expr[j].dir){return true}break}}if(j===expr.length&&cs.userSet_currentSortDirection!=="undefined"&&cs.userSet_currentSortDirection!==undefined){return true}}this._isResetClick=true;return false},removeDialogClearButton:function(){$("#"+this.grid.element[0].id+"_sorting_modalDialog_reset_button").remove()},_renderDialogButtonClearAll:function(){if(this.options.modalDialogSortOnClick===true){return}var self=this,o=this.options,resetButtonId=self.grid.element[0].id+"_sorting_modalDialog_reset_button",modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog.igGridModalDialog("getCaptionButtonContainer");$resetButton=$("<button></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:o.modalDialogResetButtonLabel,click:function(e){var noCancel,i,cs=self.options.columnSettings;noCancel=self._trigger(self.events.modalDialogButtonResetClick,e,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._tempExpr=[];for(i=0;i<cs.length;i++){if(cs[i].allowSorting!==false&&cs[i].userSet_currentSortDirection!=="undefined"&&cs[i].userSet_currentSortDirection!==undefined){self._tempExpr.push({fieldName:cs[i].columnKey,isSorting:true,dir:cs[i].userSet_currentSortDirection})}}self.renderMultipleSortingDialogContent(false);self.removeDialogClearButton();self._isResetClick=true}}})}},_multiplesortingDialogButtonOKClick:function(){var noCancel,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=this._trigger(this.events.modalDialogButtonApplyClick,null,{modalDialogElement:modalDialog,owner:this,columnsToSort:this._tempExpr});if(noCancel){this.grid.dataSource.settings.sorting.expressions=this._tempExpr;this.sortMultiple();modalDialog.igGridModalDialog("closeModalDialog")}},_insertColumnModalDialog:function($ul,$li,pos){var i,$currLi,currPos,listItems=$ul.find("li"),listItemsLength=listItems.length;if(listItemsLength===0||pos===null||pos===undefined){$li.appendTo($ul);return}for(i=0;i<listItemsLength;i++){$currLi=$(listItems[i]);currPos=$currLi.attr("li-order");if(currPos>=pos){$li.insertBefore($currLi);break}}if(i===listItemsLength){$li.appendTo($ul)}},_getColumnSettings:function(index,key){var i,foundByIndex=null;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){foundByIndex=this.options.columnSettings[i];break}if(this.options.columnSettings[i].columnIndex===index){foundByIndex=this.options.columnSettings[i];break}}return foundByIndex},_getColumnSettingsByIndex:function(index){var key=this.grid.options.columns[index].key;return this._getColumnSettings(index,key)},_headerRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.grid.element.data("igGridResizing")){this._resizing=this.grid.element.data("igGridResizing")}if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}if(this.options.mode!=="single"){this._renderMultipleSortingDialog()}},_getDataColumnSortingExpressions:function(se){if(!this.grid._hasUnboundColumns){return se}var grid=this.grid,newSE;newSE=$.grep(se,function(s){var col=grid.columnByKey(s.fieldName);return!col||col.unbound!==true});return newSE},_saveSortingExpressions:function(){if(this.options.persist){var se;if(this._restoreSorting===undefined||this._restoreSorting){$.each(this.options.columnSettings,function(i,setting){delete setting.userSet_currentSortDirection})}se=this._getDataColumnSortingExpressions(this.grid.dataSource.settings.sorting.expressions);this.grid._savePersistenceData(se,"sorting",this.grid.element[0].id);this._sortingExpressions=se;this._restoreSorting=false}},_preserveSorting:function(){var se=this.grid._getPersistenceData("sorting",this.grid.element[0].id);if(se){this._restoreSorting=true;if(se!==this._sortingExpressions){this._sortingExpressions=se}this.grid.dataSource.settings.sorting.expressions=se;this.grid.dataSource.settings.sorting.defaultFields=se}},_applyActiveSortCellStyle:function(data,col){if(this._activeSortedCol&&col===this._activeSortedCol.key){return this._activeSortedCol.asc?this.css.ascendingColumn:this.css.descendingColumn}return""},_couldPreserveData:function(){return!this.options.persist||this.grid.dataSource.settings.sorting.expressions!==this.grid._getPersistenceData("sorting",this.grid.element[0].id)},_injectGrid:function(gridInstance,isRebind){var i,cs,col,restoreSortingExpr,topmostGrid;this.grid=gridInstance;this._detachEvents();if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(this.options.persist&&this.options.type==="remote"){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid&&topmostGrid.element.attr("id")!==this.grid.element[0].id&&topmostGrid.options.initialDataBindDepth===-1){this.options.persist=false}}if(this.options.type){this.grid.dataSource.settings.sorting.type=this.options.type}else{this.grid.dataSource.settings.sorting.type="remote"}this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;this.grid.dataSource.settings.sorting.defaultFields=this.grid.dataSource.settings.sorting.expressions;this.grid.dataSource.settings.sorting.enabled=true;this.grid.dataSource.settings.sorting.sortUrlKey=this.options.sortUrlKey;this.grid.dataSource.settings.sorting.sortUrlAscValueKey=this.options.sortUrlKeyAscValue;this.grid.dataSource.settings.sorting.sortUrlDescValueKey=this.options.sortUrlKeyDescValue;if($.type(this.options.customSortFunction)==="function"){this.grid.dataSource.settings.sorting.customFunc=this.options.customSortFunction}else if(typeof this.options.customSortFunction==="string"){if(window[this.options.customSortFunction]&&typeof window[this.options.customSortFunction]==="function"){this.grid.dataSource.settings.sorting.customFunc=window[this.options.customSortFunction]}}this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._columnsRearangedHandler=$.proxy(this._columnsRearranged,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.bind("iggriduidirty",this._uiDirtyHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggrid_columnsmoved",this._columnsRearangedHandler);if(this.options.persist&&this.grid._hasUnboundColumns){cs=this.options.columnSettings;for(i=0;i<cs.length;i++){if(cs[i].columnKey&&cs[i].currentSortDirection){col=this.grid.columnByKey(cs[i].columnKey);
if(col&&col.unbound===true){delete cs[i].currentSortDirection}}}}this._initDefaultSettings();restoreSortingExpr=null;if(this.options.persist&&this.grid.element.data("igGridGroupBy")&&this.options.mode!=="single"){if(this.grid.element.data("igGridGroupBy")._getSortingExpressions()===this.grid.dataSource.settings.sorting.expressions){restoreSortingExpr=this.grid.dataSource.settings.sorting.expressions.slice(0)}}this._clearUi();if(restoreSortingExpr){this.grid.dataSource.settings.sorting.expressions=restoreSortingExpr;this._saveSortingExpressions()}this._currentActiveHeader=null;this._currentHeader=null;this._curColKey=null;if(this.options.persist){this._preserveSorting()}if(!isRebind&&(this.grid.options.rowVirtualization||this.grid.options.virtualization)){this.grid._cellStyleSubscribers.push($.proxy(this._applyActiveSortCellStyle,this))}}});$.extend($.ui.igGridSorting,{version:"15.2.20152.1027"})})(jQuery);