UNPKG

js-pkg

Version:
10 lines 505 kB
/*! * filename: ej.pivotgrid.min.js * version : 15.3.0.33 * Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ (function(n){typeof define=="function"&&define.amd?define(["./../common/ej.core.min","./../common/ej.data.min","./../common/ej.touch.min","./ej.button.min","./ej.waitingpopup.min","./ej.pivotpager.min","./ej.pivotanalysis.base.min","./ej.treeview.min","./ej.olap.base.min","./ej.pivot.common.min"],n):n()})(function(){(function(n,t,r){t.olap=t.olap||{};t.widget("ejPivotGrid","ej.PivotGrid",{_rootCSS:"e-pivotgrid",element:null,model:null,_requiresID:!0,validTags:["div","span"],defaults:{url:"",cssClass:"",jsonRecords:"",currentReport:"",layout:"normal",analysisMode:"olap",operationalMode:"clientmode",filterType:"filterType",enablePivotFieldList:!0,enableGroupingBar:!1,enableDeferUpdate:!1,enableJSONRendering:!1,enableVirtualScrolling:!1,enablePaging:!1,enableColumnResizing:!1,resizeColumnsToFit:!0,enableContextMenu:!1,enableCellContext:!1,enableRTL:!1,enableToolTip:!0,enableToolTipAnimation:!0,enableCellSelection:!1,enableConditionalFormatting:!1,enableCellEditing:!1,enableColumnGrandTotal:!0,enableRowGrandTotal:!0,enableGrandTotal:!0,enableCollapseByDefault:!1,enableCellDoubleClick:!1,enableDrillThrough:!1,isResponsive:!1,enableAdvancedFilter:!1,showUniqueNameOnPivotButton:!1,enableMemberEditorPaging:!1,enableXHRCredentials:!1,editCellsInfo:{},hyperlinkSettings:{enableValueCellHyperlink:!1,enableRowHeaderHyperlink:!1,enableColumnHeaderHyperlink:!1,enableSummaryCellHyperlink:!1},headerSettings:{showRowItems:!1,showColumnItems:!1},frozenHeaderSettings:{enableFrozenRowHeaders:!1,enableFrozenColumnHeaders:!1,enableFrozenHeaders:!1,scrollerSize:18},valueSortSettings:{headerText:"",headerDelimiters:"##",sortOrder:t.PivotAnalysis.SortOrder.None},serviceMethodSettings:{initialize:"InitializeGrid",drillDown:"DrillGrid",exportPivotGrid:"Export",paging:"Paging",fetchMembers:"FetchMembers",nodeStateModified:"NodeStateModified",nodeDropped:"NodeDropped",filtering:"Filtering",sorting:"Sorting",valueSorting:"ValueSorting",deferUpdate:"DeferUpdate",memberExpand:"MemberExpanded",writeBack:"WriteBack",cellEditing:"CellEditing",saveReport:"SaveReport",loadReport:"LoadReportFromDB",calculatedField:"CalculatedField",drillThroughHierarchies:"DrillThroughHierarchies",drillThroughDataTable:"DrillThroughDataTable",removeButton:"RemoveButton"},customObject:{},locale:"en-US",dataSource:{data:null,sourceInfo:"",providerName:"ssas",enableAdvancedFilter:!1,isFormattedValues:!1,reportName:"Default",columns:[],cube:"",catalog:"",rows:[],values:[],filters:[],pagerOptions:{categoricalPageSize:0,seriesPageSize:0,categoricalCurrentPage:0,seriesCurrentPage:0}},pivotTableFieldListID:"",collapsedMembers:null,cellSelection:null,valueCellHyperlinkClick:null,rowHeaderHyperlinkClick:null,columnHeaderHyperlinkClick:null,summaryCellHyperlinkClick:null,beforeServiceInvoke:null,afterServiceInvoke:null,drillThrough:null,drillSuccess:null,cellContext:null,load:null,renderComplete:null,renderFailure:null,renderSuccess:null,cellDoubleClick:null,applyFieldCaption:null,beforeExport:null,beforePivotEnginePopulate:null,saveReport:null,loadReport:null,cellEdit:null,memberEditorPageSize:100},dataTypes:{dataSource:{data:"data",columns:"array",rows:"array",values:"array",filters:"array"},serviceMethodSettings:{initialize:"enum",drillDown:"enum",exportPivotGrid:"enum",paging:"enum",fetchMembers:"enum",nodeStateModified:"enum",nodeDropped:"enum",filtering:"enum",sorting:"enum",deferUpdate:"enum",memberExpand:"enum",writeBack:"enum",cellEditing:"enum",saveReport:"enum",loadReport:"enum",calculatedField:"enum",drillThroughHierarchies:"enum",drillThroughDataTable:"enum",removeButton:"enum"},customObject:"data"},observables:["layout","enableCellContext","hyperlinkSettings.enableValueCellHyperlink","hyperlinkSettings.enableRowHeaderHyperlink","hyperlinkSettings.enableColumnHeaderHyperlink","hyperlinkSettings.enableSummaryCellHyperlink"],layout:t.util.valueFunction("layout"),enableCellContext:t.util.valueFunction("enableCellContext"),enableValueCellHyperlink:t.util.valueFunction("hyperlinkSettings.enableValueCellHyperlink"),enableRowHeaderHyperlink:t.util.valueFunction("hyperlinkSettings.enableRowHeaderHyperlink"),enableColumnHeaderHyperlink:t.util.valueFunction("hyperlinkSettings.enableColumnHeaderHyperlink"),enableSummaryCellHyperlink:t.util.valueFunction("hyperlinkSettings.enableSummaryCellHyperlink"),locale:t.util.valueFunction("locale"),getOlapReport:function(){return this._olapReport},setOlapReport:function(n){this._olapReport=n},getJSONRecords:function(){return this._JSONRecords},setJSONRecords:function(t){this._JSONRecords=n.parseJSON(t)},_init:function(){this._initPrivateProperties();this._load()},_destroy:function(){n(this.element).next().length>0&&n(this.element).next()[0].className=="e-pGridTooltip"&&n(this.element).next().remove();this.element.empty().removeClass("e-pivotgrid"+this.model.cssClass).removeAttr("tabindex");this._waitingPopup!=r&&this._waitingPopup.destroy();this.element.attr("class")==""&&this.element.removeAttr("class")},_initPrivateProperties:function(){this._id=this.element.attr("id");this._olapReport="";this._JSONRecords=null;this._excelLikeJSONRecords=null;this._drillCaption="";this._drillAction="";this._startDrilldown=!1;this._pagerObj=null;this._seriesPageCount=null;this._categPageCount=null;this._seriesCurrentPage=1;this._categCurrentPage=1;this._drillHeaders=[];this._collapsedRowHeaders=[];this._isDragging=!1;this._droppedClass="";this._dataModel="";this._ascdes="";this._filterUpdate=[];this._pivotRow=[];this._pivotColumn=[];this._pivotCalculation=[];this._pivotFilter=[];this._pivotTableFields=[];this._schemaData=null;this._waitingPopup=null;this._oriX=null;this._oriY=null;this._startPosCell=null;this._maxViewLoading=null;this._list=[];this._list.push(this._getLocalizedLabels("AddNew"));this._rowCount=0;this._excelRowCount=0;this._dialogTitle="";this._selectedField="";this._selectedAxis="";this._isUpdateRequired=!1;this._isMembersFiltered=!1;this._selectedCell=null;this._onholdKey="";this._primaryCellPos="";this._prevDrillElements=[];this._currentReportItems=[];this._rowHeader=[];this._colHeader=[];this._cellInfo=[];this._editorFlag=!0;this._isSubTotalHide=!1;this._isSubTotalhidden=!1;this._dimension;this._calculatedField=[];this._isFormatApply=!1;this._cFormat=[];this._curFocus={cell:null,tab:null,tree:null,cformat:null,grp:null,selection:null,filter:null,field:null,formula:null};this._index={index:0,grp:1,cell:1,dialog:1,paging:1,cformat:1,filter:0,field:0,formula:0};this._dataSet=[];this._currentCell=-1;this._target=null;this._orgX=null;this._orgY=null;this._expand=!1;this._excelFilterInfo=[];this._pagingSavedObjects={drillEngine:[],savedHdrEngine:[],curDrilledItem:{}};this._isSchemaInitialize=!0;this._fieldMembers={};this._fieldSelectedMembers={};this._allMember="";this._selectedMeasure="";this._selectedFormat="";this._dialogName="";this._pivotClientObj=null;this._memberPageSettings={currentMemeberPage:1,startPage:0,endPage:0};this._memberSearchPageSettings={currentMemberSearchPage:1,startSearchPage:0,endSearchPage:0};this._isAllMemberChecked=!0;this._editorTreeData=[];this._editorSearchTreeData=[];this._memberPagingAvdData=[];this._table="";this._drillParams={currRow:"",currCol:"",currPos:""};this._croppedJson=[];this._compJson=[];this._isNavigation=!1;this._isOptionSearch=!1;this._isSelectSearchFilter=!0;this._currentFilterList={};this._rawData=[]},_load:function(){var f={element:this.element,customObject:this.model.customObject},u,r,i;if((this.model.enableAdvancedFilter||this.model.dataSource.enableAdvancedFilter)&&(this.model.dataSource.enableAdvancedFilter=this.model.enableAdvancedFilter=!0),this.model.enableCellEditing&&this.model.enableCellSelection&&(this.model.enableCellSelection=!1),this._trigger("load",f),this.element.addClass(this.model.cssClass),n(this.element).parents(".e-pivotclient").length>0?(this._pivotClientObj=n(this.element).parents(".e-pivotclient").data("ejPivotClient"),n("#"+this._pivotClientObj._id+"_maxView")[0]&&n("#"+this._pivotClientObj._id+"_maxView").ejWaitingPopup({showOnInit:!0}),t.isNullOrUndefined(this._waitingPopup)&&!t.isNullOrUndefined(this._pivotClientObj._waitingPopup)&&(this._waitingPopup=this._pivotClientObj._waitingPopup),this._waitingPopup.show()):t.isNullOrUndefined(this._waitingPopup)&&(n("#"+this._id).ejWaitingPopup({showOnInit:!0}),this._waitingPopup=n("#"+this._id).data("ejWaitingPopup")),this._waitingPopup.show(),this.model.enableJSONRendering)this.setJSONRecords(this.model.jsonRecords),this.layout().toLowerCase()==t.PivotGrid.Layout.ExcelLikeLayout?this.excelLikeLayout(this.getJSONRecords()):this.renderControlFromJSON();else if(t.isNullOrUndefined(this.model.dataSource.data)&&this.model.url==""&&!t.isNullOrUndefined(this._pivotClientObj))this.renderControlFromJSON(),this._waitingPopup.hide();else if(this.model.dataSource.data==null&&this.model.url!=""||this.model.dataSource.data!=null&&this.model.url!=""&&this.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode)this.model.operationalMode=t.Pivot.OperationalMode.ServerMode,t.isNullOrUndefined(this.model.beforeServiceInvoke)||this._trigger("beforeServiceInvoke",{action:"initialize",element:this.element,customObject:this.model.customObject}),u=JSON.stringify(this.model.customObject),this.model.enableVirtualScrolling&&(this.model.layout=t.PivotGrid.Layout.NoSummaries),this.element[0]!=null&&this.element.parents().find(".e-controlPanel").length>0&&this.layout()!=""&&this.layout()!=t.PivotGrid.Layout.Normal?this.doAjaxPost("POST",this.model.url+"/"+this.model.serviceMethodSettings.initialize,JSON.stringify({action:"initializeGrid",currentReport:this.model.currentReport,gridLayout:this.layout(),customObject:u}),this._renderControlSuccess):this.element[0]!=null&&this.element.parents().find(".e-controlPanel").length>0?this.doAjaxPost("POST",this.model.url+"/"+this.model.serviceMethodSettings.initialize,JSON.stringify({action:this.model.enableCellDoubleClick||this.model.enableDrillThrough?"initializeGrid:getDataSet":"initializeGrid",currentReport:this.model.currentReport,customObject:u}),this._renderControlSuccess):this.doAjaxPost("POST",this.model.url+"/"+this.model.serviceMethodSettings.initialize,JSON.stringify({action:this.model.enableCellDoubleClick||this.model.enableDrillThrough?"initializeGrid:getDataSet":"initializeGrid",gridLayout:this.layout(),enablePivotFieldList:this.model.enablePivotFieldList,valueSorting:JSON.stringify(this.model.valueSortSettings),customObject:u}),this._renderControlSuccess);else if(this.model.operationalMode=t.Pivot.OperationalMode.ClientMode,this.model.dataSource.cube!="")this.model.analysisMode=t.Pivot.AnalysisMode.Olap,this._trigger("beforePivotEnginePopulate",{pivotGridObj:this}),t.olap.base.getJSONData({action:"initialLoad"},this.model.dataSource,this);else if(this.model.dataSource.data!=null){for(r=!1,i=0;i<this.model.dataSource.rows.length;i++)r=this._applyGrouping("rows",i),r&&i--;for(i=0;i<this.model.dataSource.columns.length;i++)r=this._applyGrouping("columns",i),r&&i--;for(i=0;i<this.model.dataSource.values.length;i++)r=this._applyGrouping("values",i),r&&i--;for(i=0;i<this.model.dataSource.filters.length;i++)r=this._applyGrouping("filters",i),r&&i--;this.model.analysisMode=t.Pivot.AnalysisMode.Pivot;t.PivotAnalysis.setFieldCaptions(this.model.dataSource);this._populatePivotGrid()}},_formatChange:function(n,t,i){var u=t.split(i),r;return u[0].indexOf("M")>-1&&u[1].indexOf("d")>-1||u[1].indexOf("M")>-1&&u[2].indexOf("d")>-1?n:u[1].indexOf("M")>-1&&u[0].indexOf("d")>-1?(r=n.split(i),r[1]+i+r[0]+i+r[2]):u[2].indexOf("M")>-1&&u[0].indexOf("d")>-1?(r=n.split(i),r[2]+i+r[0]+i+r[1]):u[2].indexOf("M")>-1&&u[1].indexOf("d")>-1?(r=n.split(i),r[2]+i+r[1]+i+r[0]):u[0].indexOf("M")>-1&&u[2].indexOf("d")>-1?(r=n.split(i),r[0]+i+r[2]+i+r[1]):void 0},_applyGrouping:function(n,i){var u,f;this._rawData=this.model.dataSource.data;var e=this.model.dataSource.data,h=-1,c=!1;for(h=-1,u=0;this.model.dataSource[n][i].format=="date"&&this.model.dataSource[n][i].formatString!=r&&this.model.dataSource[n][i].delimiter!=r&&this.model.dataSource[n][i].groupByDate!=r&&u<this.model.dataSource[n][i].groupByDate.interval.length;u++){var l=this.model.dataSource[n][i].groupByDate.interval[u].indexOf("MM")>-1&&this.model.dataSource[n][i].groupByDate.interval[u].indexOf("dd")==-1?this._getLocalizedLabels("Months"):this.model.dataSource[n][i].groupByDate.interval[u].indexOf("dd")>-1?this._getLocalizedLabels("Days"):this.model.dataSource[n][i].groupByDate.interval[u].indexOf("qq")>-1?this._getLocalizedLabels("Quarters"):this._getLocalizedLabels("Years"),s=this.model.dataSource[n][i].formatString,o=this.model.dataSource[n][i].delimiter,a={fieldName:l+" ("+this.model.dataSource[n][i].fieldName+")",fieldCaption:l+" ("+this.model.dataSource[n][i].fieldName+")"};for(this.model.dataSource[n].push(a),f=0;f<e.length;f++)e[f][a.fieldName]=this.model.dataSource[n][i].groupByDate.interval[u].indexOf("MM")>-1&&this.model.dataSource[n][i].groupByDate.interval[u].indexOf("DD")==-1?t.PivotAnalysis._setFormat(this._formatChange(e[f][this.model.dataSource[n][i].fieldName],s,o),this.model.dataSource[n][i].format,this.model.dataSource[n][i].groupByDate.interval[u]):this.model.dataSource[n][i].groupByDate.interval[u].indexOf("dd")>-1?t.PivotAnalysis._setFormat(this._formatChange(e[f][this.model.dataSource[n][i].fieldName],s,o),this.model.dataSource[n][i].format,this.model.dataSource[n][i].groupByDate.interval[u]):this.model.dataSource[n][i].groupByDate.interval[u].indexOf("qq")>-1?(this.model.dataSource[n][i].groupByDate.interval[u]=="qq"?this._getLocalizedLabels("Qtr")+" "+o:this._getLocalizedLabels("Quarter")+" "+o)+this._getQuarter(this._formatChange(e[f][this.model.dataSource[n][i].fieldName],s,o)):t.PivotAnalysis._setFormat(this._formatChange(e[f][this.model.dataSource[n][i].fieldName],s,o),this.model.dataSource[n][i].format,this.model.dataSource[n][i].groupByDate.interval[u]);h=i}return h!=-1&&(this.model.dataSource[n].splice(i,1),c=!0),c},_getQuarter:function(n){if(jQuery.isNumeric(n))t=new Date((Number(n)-2)*864e5+new Date("01/01/1900").getTime());else if(new Date(n)!="Invalid Date")var t=new Date(n);else t=new Date((Number(0)-2)*864e5+new Date("01/01/1900").getTime());return Math.floor((t.getMonth()+3)/3)},refreshControl:function(){if(t.Pivot.openPreventPanel(this),this._trigger("beforePivotEnginePopulate",{pivotObject:this}),this.model.enableGroupingBar&&this._createGroupingBar(this.model.dataSource),this.model.analysisMode==t.Pivot.AnalysisMode.Pivot){var n=t.PivotAnalysis.pivotEnginePopulate(this.model);this.setJSONRecords(JSON.stringify(n.json));this.layout().toLowerCase()==t.PivotGrid.Layout.ExcelLikeLayout?this.excelLikeLayout(n.json):this.renderControlFromJSON(n.json);this._trigger("renderSuccess",this)}else t.olap.base.getJSONData({action:"initialLoad"},this.model.dataSource,this)},_setCaptions:function(){n.each(this.model.dataSource.rows,function(n,i){t.isNullOrUndefined(i.fieldCaption)&&(i.fieldCaption=i.fieldName)});n.each(this.model.dataSource.columns,function(n,i){t.isNullOrUndefined(i.fieldCaption)&&(i.fieldCaption=i.fieldName)});n.each(this.model.dataSource.filters,function(n,i){t.isNullOrUndefined(i.fieldCaption)&&(i.fieldCaption=i.fieldName)});n.each(this.model.dataSource.values,function(n,i){t.isNullOrUndefined(i.fieldCaption)&&(i.fieldCaption=i.fieldName)})},refreshFieldCaption:function(n,t,i){var r;if(i.indexOf("row")>=0)for(r=0;r<this.model.dataSource.rows.length;r++)n==this.model.dataSource.rows[r].fieldName&&(this.model.dataSource.rows[r].fieldCaption=t);else if(i.indexOf("calc")>=0)for(r=0;r<this.model.dataSource.values.length;r++)n==this.model.dataSource.values[r].fieldName&&(this.model.dataSource.values[r].fieldCaption=t);else if(i.indexOf("col")>=0)for(r=0;r<this.model.dataSource.columns.length;r++)n==this.model.dataSource.columns[r].fieldName&&(this.model.dataSource.columns[r].fieldCaption=t);else for(r=0;r<this.model.dataSource.filters.length;r++)n==this.model.dataSource.filters[r].fieldName&&(this.model.dataSource.filters[r].fieldCaption=t);for(r=0;r<this._pivotTableFields.length;r++)n==this._pivotTableFields[r].name&&(this._pivotTableFields[r].caption=t)},refreshPivotGrid:function(){this.model.operationalMode==t.PivotGrid.OperationalMode.ClientMode?this.model.analysisMode==t.Pivot.AnalysisMode.Pivot?(this.getOlapReport()&&(this.model.dataSource.rows&&(this.model.dataSource.rows=this.getOlapReport().rows),this.model.dataSource.columns&&(this.model.dataSource.columns=this.getOlapReport().columns),this.model.dataSource.filters&&(this.model.dataSource.filters=this.getOlapReport().filters),this.model.dataSource.values&&(this.model.dataSource.values=this.getOlapReport().values)),this.model.editCellsInfo={},this._populatePivotGrid()):(this._trigger("beforePivotEnginePopulate",{olapObject:this}),t.olap.base.getJSONData({action:"initialLoad"},this.model.dataSource,this)):this._load()},_populatePivotGrid:function(){var f,u,r,i,e;for(this._trigger("beforePivotEnginePopulate",{pivotObject:this}),f=n(this.element).parents(".e-pivotclient").length>0?n(this.element).parents(".e-pivotclient").data("ejPivotClient"):null,u=n.grep(this.model.dataSource.values,function(n){return n.isCalculatedField==!0}),this.model.dataSource.values=n.grep(this.model.dataSource.values,function(n){return t.isNullOrUndefined(n.isCalculatedField)||n.isCalculatedField==!1}),r=0;r<u.length;r++)i=u[r].formula,n.grep(this._calculatedField,function(n){return n.name==u[r].fieldName}).length==0&&(i=i.replace(/\s+|\s+$/gm,""),i=this._parenthesisAsterisk(i),i=i.replace(/[-+/^%*]/g,function(n){return" "+n+" "}),this._calculatedField.push({name:u[r].fieldName,formula:i})),u[r].formula=i,this.model.dataSource.values.push(u[r]);e=t.PivotAnalysis.pivotEnginePopulate(this.model);this.setJSONRecords(JSON.stringify(e.json));this.setOlapReport(this.model.dataSource);this._createGroupingBar(this.model.dataSource);this.layout().toLowerCase()==t.PivotGrid.Layout.ExcelLikeLayout?this.excelLikeLayout(e.json):this.renderControlFromJSON();t.isNullOrUndefined(f)||(f._isTimeOut=!1);this._waitingPopup.hide();this._trigger("renderSuccess",this);t.isNullOrUndefined(this._pivotClientObj)||typeof this._pivotClientObj._pivotSchemaDesigner=="undefined"||(this._schemaData=this._pivotClientObj._pivotSchemaDesigner);this._schemaData!=null&&(t.isNullOrUndefined(this._schemaData._waitingPopup)?this._waitingPopup.hide():this._schemaData._waitingPopup.hide(),this._calculatedField.length>0&&this._schemaCalculatedField())},_setFirst:!1,_setModel:function(i){for(var r in i)switch(r){case"OlapReport":this.setOlapReport(i[r]);break;case"JsonData":this.setOlapReport(i[r]);break;case"RefreshOlapGrid":this.element.renderControlFromJSON(i[r]);break;case"layout":this.layout(t.util.getVal(i[r]));this._load();break;case"customObject":this.model.customObject=i[r];break;case"enableCellContext":this.enableCellContext(t.util.getVal(i[r]));this._load();break;case"hyperlinkSettings":!t.isNullOrUndefined(t.util.getVal(i[r]).enableValueCellHyperlink)&&n.isFunction(t.util.getVal(i[r]).enableValueCellHyperlink)?this.enableValueCellHyperlink(i[r].enableValueCellHyperlink()):t.isNullOrUndefined(i[r].enableValueCellHyperlink)||this.enableValueCellHyperlink(i[r].enableValueCellHyperlink);!t.isNullOrUndefined(t.util.getVal(i[r]).enableRowHeaderHyperlink)&&n.isFunction(t.util.getVal(i[r]).enableRowHeaderHyperlink)?this.enableRowHeaderHyperlink(i[r].enableRowHeaderHyperlink()):t.isNullOrUndefined(i[r].enableRowHeaderHyperlink)||this.enableRowHeaderHyperlink(i[r].enableRowHeaderHyperlink);!t.isNullOrUndefined(t.util.getVal(i[r]).enableColumnHeaderHyperlink)&&n.isFunction(t.util.getVal(i[r]).enableColumnHeaderHyperlink)?this.enableColumnHeaderHyperlink(i[r].enableColumnHeaderHyperlink()):t.isNullOrUndefined(i[r].enableColumnHeaderHyperlink)||this.enableColumnHeaderHyperlink(i[r].enableColumnHeaderHyperlink);!t.isNullOrUndefined(t.util.getVal(i[r]).enableSummaryCellHyperlink)&&n.isFunction(t.util.getVal(i[r]).enableSummaryCellHyperlink)?this.enableSummaryCellHyperlink(i[r].enableSummaryCellHyperlink()):t.isNullOrUndefined(i[r].enableSummaryCellHyperlink)||this.enableSummaryCellHyperlink(i[r].enableSummaryCellHyperlink);this._load();break;case"operationalMode":this.model.operationalMode=i[r];break;case"analysisMode":this.model.analysisMode=i[r];break;case"locale":this.locale(t.util.getVal(i[r]));this._load();break;case"dataSource":this.model.dataSource=n.extend({},this.model.dataSource,i[r]);this.refreshControl();this._schemaData&&this._schemaData._load();break;case"enableGroupingBar":this.model.enableGroupingBar=i[r];this._load();break;case"enableDeferUpdate":this.model.enableGroupingBar=i[r];this._load();break;case"enableJSONRendering":this.model.enableJSONRendering=i[r];this._load();break;case"enableVirtualScrolling":this.model.enableVirtualScrolling=i[r];this._load();break;case"enablePaging":this.model.enablePaging=i[r];this._load();break;case"enableColumnResizing":this.model.enableColumnResizing=i[r];this._load();break;case"resizeColumnsToFit":this.model.resizeColumnsToFit=i[r];this.renderControlFromJSON();break;case"enableContextMenu":this.model.enableContextMenu=i[r];this._load();break;case"enableRTL":this.model.enableRTL=i[r];this._load();break;case"enableToolTip":this.model.enableToolTip=i[r];break;case"enableToolTipAnimation":this.model.enableToolTipAnimation=i[r];break;case"enableCellSelection":this.model.enableCellSelection=i[r];this._load();break;case"enableConditionalFormatting":this.model.enableConditionalFormatting=i[r];this._load();break;case"enableCellEditing":this.model.enableCellEditing=i[r];this._load();break;case"enableColumnGrandTotal":this.model.enableColumnGrandTotal=i[r];this._load();break;case"enableRowGrandTotal":this.model.enableRowGrandTotal=i[r];this._load();break;case"enableGrandTotal":this.model.enableGrandTotal=i[r];this._load();break;case"enableCollapseByDefault":this.model.enableCollapseByDefault=i[r];this._load();break;case"enableCellDoubleClick":this.model.enableCellDoubleClick=i[r];this._load();break;case"enableDrillThrough":this.model.enableDrillThrough=i[r];this._load();break;case"isResponsive":this.model.isResponsive=i[r];this._load();break;case"enableAdvancedFilter":this.model.enableAdvancedFilter=i[r];this._load();break;case"showUniqueNameOnPivotButton":this.model.showUniqueNameOnPivotButton=i[r];this._load();break;case"enableMemberEditorPaging":this.model.enableMemberEditorPaging=i[r];this._load();break;case"frozenHeaderSettings":this.model.frozenHeaderSettings=n.extend({},this.model.frozenHeaderSettings,i[r]);this.refreshControl();break;case"valueSortSettings":this.model.valueSortSettings=n.extend({},this.model.valueSortSettings,i[r]);this.refreshControl()}},_wireEvents:function(){if(this._on(this.element,"mouseover",".value,.rowheader,.colheader,.summary",t.proxy(function(t){var i,r,u;n(t.target).hasClass("cellValue")||n(t.target).children().hasClass("cellValue")||(i=n(t.target).contents().filter(function(){return this.nodeType==3}),i.text()!=0&&(r=n(t.target).find(".valueSorting").length>0?!0:!1,u=r?n(t.target).find(".valueSorting"):"",n(t.target).find(".valueSorting").remove(),n(t.target).contents().filter(function(){return this.nodeType==3}).remove(),n(t.target).append("<span class='cellValue'>"+i.text()+"<\/span>"),r&&(n(t.target).hasClass("colheader")||n(t.target).hasClass("summary"))&&n(t.target).hasClass("calc")&&!n(t.target).hasClass("rowheader")?n(t.target).append(u):""))})),this._on(this.element,"contextmenu",".value,.rowheader,.colheader,.summary",t.proxy(function(i){var o;if(this.model.enableContextMenu&&t.isNullOrUndefined(this._pivotClientObj)&&!this.model.enableCellContext){i.preventDefault();var r="",u="",f="",e="";e=this.model.analysisMode==t.Pivot.AnalysisMode.Pivot?"<li><a>"+this._getLocalizedLabels("Layouts")+"<\/a><ul><li id='normalLayout'><a>"+this._getLocalizedLabels("NormalLayout")+"<\/a><li><li id='excelLikeLayout'><a>"+this._getLocalizedLabels("ExcelLikeLayout")+"<\/a><li><\/ul><\/li>":this.model.analysisMode==t.Pivot.AnalysisMode.Olap&&this.model.operationalMode==t.Pivot.OperationalMode.ClientMode?"<li><a>"+this._getLocalizedLabels("Layouts")+"<\/a><ul><li id='normalLayout'><a>"+this._getLocalizedLabels("NormalLayout")+"<\/a><li><li id='excelLikeLayout'><a>"+this._getLocalizedLabels("ExcelLikeLayout")+"<\/a><li><li id='noSummariesLayout'><a>"+this._getLocalizedLabels("NoSummaries")+"<\/a><li><\/ul><\/li>":"<li><a>"+this._getLocalizedLabels("Layouts")+"<\/a><ul><li id='normalLayout'><a>"+this._getLocalizedLabels("NormalLayout")+"<\/a><li><li id='excelLikeLayout'><a>"+this._getLocalizedLabels("ExcelLikeLayout")+"<\/a><li><li id='noSummariesLayout'><a>"+this._getLocalizedLabels("NoSummaries")+"<\/a><li><li id='normalTopSummaryLayout'><a>"+this._getLocalizedLabels("NormalTopSummary")+"<\/a><li><\/ul><\/li>";r=((this.model.analysisMode==t.Pivot.AnalysisMode.Pivot||this.model.analysisMode==t.Pivot.AnalysisMode.Olap)&&this.model.operationalMode==t.Pivot.OperationalMode.ServerMode)?"":t.buildTag("li.e-advancedFiltering",t.buildTag("a",this._getLocalizedLabels("AdvancedFiltering"))[0].outerHTML)[0].outerHTML;this.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&(f=t.buildTag("li.e-collapseByDefault",t.buildTag("a",this._getLocalizedLabels("CollapseByDefault"))[0].outerHTML)[0].outerHTML);this.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&this.model.operationalMode==t.Pivot.OperationalMode.ClientMode&&(u=t.buildTag("li.e-numberFormatting",t.buildTag("a",this._getLocalizedLabels("NumberFormatting"))[0].outerHTML)[0].outerHTML);var s="<li><a>"+this._getLocalizedLabels("HyperLink")+"<\/a><ul><li id='rowHeader'><a>"+this._getLocalizedLabels("EnableRowHeaderHyperlink")+"<\/a><\/li><li id='columnHeader'><a>"+this._getLocalizedLabels("EnableColumnHeaderHyperlink")+"<\/a><\/li><li id='valueCell'><a>"+this._getLocalizedLabels("EnableValueCellHyperlink")+"<\/a><\/li><li id='summaryCell'><a>"+this._getLocalizedLabels("EnableSummaryCellHyperlink")+"<\/a><\/li><\/ul><\/li>",h="<li><a>"+this._getLocalizedLabels("Exporting")+"<\/a><ul><li id='excel'><a>"+this._getLocalizedLabels("Excel")+"<\/a><\/li><li id='word'><a>"+this._getLocalizedLabels("Word")+"<\/a><\/li><li id='pdf'><a>"+this._getLocalizedLabels("PDF")+"<\/a><\/li><li id='csv'><a>"+this._getLocalizedLabels("CSV")+"<\/a><\/li><\/ul><\/li>",c="<li class='e-separator'><a>"+this._getLocalizedLabels("FrozenHeader")+"<\/a><ul><li id='row'><a>"+this._getLocalizedLabels("Row")+"<\/a><\/li><li id='column'><a>"+this._getLocalizedLabels("Column")+"<\/a><\/li><\/ul><\/li>",l=t.buildTag("ul#"+this._id+"contextMenu.e-pivotGridContextMenu",t.buildTag("li.e-cellSelect",t.buildTag("a",this._getLocalizedLabels("CellSelection"))[0].outerHTML)[0].outerHTML+t.buildTag("li.e-columnResize",t.buildTag("a",this._getLocalizedLabels("ColumnResize"))[0].outerHTML)[0].outerHTML+t.buildTag("li.e-toolTip",t.buildTag("a",this._getLocalizedLabels("ToolTip"))[0].outerHTML)[0].outerHTML+f+r+t.buildTag("li.groupingBar",t.buildTag("a",this._getLocalizedLabels("GroupingBar"))[0].outerHTML)[0].outerHTML+(this.model.analysisMode=="pivot"?t.buildTag("li.e-cellEditing",t.buildTag("a",this._getLocalizedLabels("CellEditing"))[0].outerHTML)[0].outerHTML:"")+t.buildTag("li.e-drillThrough",t.buildTag("a",this._getLocalizedLabels("DrillThrough"))[0].outerHTML)[0].outerHTML+t.buildTag("li.rtl",t.buildTag("a",this._getLocalizedLabels("RTL"))[0].outerHTML)[0].outerHTML+e+s+h+c+t.buildTag("li.e-summaryCustomize",t.buildTag("a",this._getLocalizedLabels("SummaryCustomization"))[0].outerHTML)[0].outerHTML+t.buildTag("li.e-conditionalFormat",t.buildTag("a",this._getLocalizedLabels("ConditionalFormatting"),{})[0].outerHTML)[0].outerHTML+(this.model.analysisMode=="pivot"?t.buildTag("li.e-calculatedField",t.buildTag("a",this._getLocalizedLabels("CalculatedField"))[0].outerHTML)[0].outerHTML+u+(this.model.operationalMode==t.PivotGrid.OperationalMode.ClientMode?t.buildTag("li.e-summaryTypes",t.buildTag("a",this._getLocalizedLabels("SummaryTypes"),{})[0].outerHTML)[0].outerHTML:""):""))[0].outerHTML;n("#"+this._id).append(l);n("li.rtl").addClass("e-separator");o=this.element.find(".e-pivotGridTable");this.element.find("#"+this._id+"contextMenu").ejMenu({width:"200px",menuType:t.MenuType.ContextMenu,contextMenuTarget:o,enableRTL:this.model.enableRTL,click:t.proxy(this._contextMenuClick,this)});this._stateMaintenance()}})),this._on(n(document),"keydown",this._keyDownPress),this._on(n(document),"keyup",this._keyUpPress),this.model.enableCellSelection&&(this._on(this.element,"mousedown touchstart",".value",this._initCellSelection),this._on(this.element,"click",".colheader,.rowheader",this._headerClickCellSelection)),this.enableCellContext()==!0&&(document.addEventListener?(document.removeEventListener("contextmenu",this._cellContext,!1),document.addEventListener("contextmenu",this._cellContext,!1)):(document.detachEvent("oncontextmenu",this._cellContext),document.attachEvent("oncontextmenu",this._cellContext))),this._on(this.element,"mouseover",".e-pivotButton",t.proxy(function(i){this._isDragging&&(this.element.append(t.buildTag("span.e-dropIndicator e-dropIndicatorActive")[0].outerHTML),i.target.className.indexOf("e-pivotButton")>=0?this.element.find(".e-dropIndicator").css("top",n(i.target).position().top-20).css("left",n(i.target).position().left-3):this.element.find(".e-dropIndicator").css("top",n(i.target).parents(".e-pivotButton").position().top-20).css("left",n(i.target).parents(".e-pivotButton").position().left-3))},this)),this._on(this.element,"mouseleave",".e-pivotButton",t.proxy(function(){this._isDragging&&this.element.find(".e-dropIndicator").removeClass("e-dropIndicatorActive")},this)),this._on(this.element,"click","#preventDiv",t.proxy(function(){this.element.find(".e-dialog.e-advancedFilterDlg:visible").length>0&&(this.element.find(".e-dialog.e-advancedFilterDlg").hide(),this.element.find("#preventDiv").remove())},this)),this.model.enableCellEditing&&this._on(this.element,"mousedown",".value",this._initCellEditing),this.drillDownHandler=n.proxy(this._drillDown,this),this.addHyperlinkHandler=n.proxy(this._addHyperlink,this),this.removeHyperlinkHandler=n.proxy(this._removeHyperlink,this),this.model.enableCellSelection){n(document).on("click",this._clearSelection);n(document).on("keyup",this._endCellSelection);n(document).on("keydown",this._startCellSelection)}this._on(this.element,"mouseover",this.model.analysisMode==t.Pivot.AnalysisMode.Olap?".value .cellValue, .rowheader .cellValue, .colheader .cellValue":".value .cellValue, .rowheader .cellValue, .colheader .cellValue, .summary .cellValue",this.addHyperlinkHandler);this._on(this.element,"mouseleave",this.model.analysisMode==t.Pivot.AnalysisMode.Olap?".value, .rowheader, .colheader":".value .cellValue, .rowheader .cellValue, .colheader .cellValue, .summary .cellValue",this.removeHyperlinkHandler);this._on(this.element,"click",this.model.analysisMode==t.Pivot.AnalysisMode.Olap?".value .cellValue, .rowheader .cellValue, .colheader .cellValue":".value .cellValue, .rowheader .cellValue, .colheader .cellValue, .summary .cellValue",function(i){if(i.target.className.indexOf("hyperlink")!=-1){var u=this._excelLikeJSONRecords!=null&&this.layout().toLowerCase()==t.PivotGrid.Layout.ExcelLikeLayout?n(i.target.parentElement).attr("data-i"):n(i.target.parentElement).attr("data-p"),f=this._excelLikeJSONRecords!=null&&this.layout().toLowerCase()==t.PivotGrid.Layout.ExcelLikeLayout?this._excelLikeJSONRecords[parseInt(parseInt(u.split(",")[0])*this._rowCount+parseInt(u.split(",")[1]))].Info:this.getJSONRecords()[parseInt(parseInt(u.split(",")[0])*this._excelRowCount+parseInt(u.split(",")[1]))].Info,r={cellValue:i.target.innerHTML,cellPosition:u,cellType:i.target.parentElement.className.split(" ")[0],uniqueName:f.split("::")[0],args:i,rawdata:f};this.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&i.target.parentElement.className.indexOf("summary")>=0||i.target.parentElement.className.indexOf("summary value")>=0?t.isNullOrUndefined(this._pivotClientObj)?this._trigger("summaryCellHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}):this._pivotClientObj._trigger("summaryCellHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}):i.target.parentElement.className.indexOf("value")>=0?t.isNullOrUndefined(this._pivotClientObj)?this._trigger("valueCellHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}):this._pivotClientObj._trigger("valueCellHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}):i.target.parentElement.className.indexOf("rowheader")>=0?t.isNullOrUndefined(this._pivotClientObj)?this._trigger("rowHeaderHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}):this._pivotClientObj._trigger("rowHeaderHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}):i.target.parentElement.className.indexOf("colheader")>=0&&(t.isNullOrUndefined(this._pivotClientObj)?this._trigger("columnHeaderHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}):this._pivotClientObj._trigger("columnHeaderHyperlinkClick",{element:this.element,customObject:this.model.customObject,args:r}));i.target.parentElement.className.indexOf("value")>=0&&this.model.enableDrillThrough&&(this._rowHeader=[],this._colHeader=[],this.model.analysisMode==t.Pivot.AnalysisMode.Olap?t.Pivot._drillThroughCellClick(i,this):this._cellRangeInfo(i))}});this._on(this.element,"click",this.model.analysisMode==t.Pivot.AnalysisMode.Pivot?".rowheader, .colheader, .summary":".rowheader, .colheader",function(i){var r,e,s,o,h,u,c,f;if(this.model.enableCellSelection&&!(n(i.target).hasClass("cellValue")&&n(i.target).hasClass("hyperlinkHeaderCell")))if(r=n(i.target).hasClass("cellValue")?i.target.parentElement:i.target,i.shiftKey){if(window.getSelection().removeAllRanges(),n(this.element).find(".e-selected").removeClass("e-selected"),e=n(this._selectedCell).attr("data-p"),s=n(r).attr("data-p"),(n(r).hasClass("rowheader")||n(r).attr("role")=="rowheader")&&(n(this._selectedCell).hasClass("rowheader")||n(this._selectedCell).attr("role")=="rowheader"))for(u=Math.min(e.split(",")[1],s.split(",")[1]);u<=Math.max(e.split(",")[1],s.split(",")[1]);u++)this.element.find("[data-p='"+e.split(",")[0]+","+u+"']").addClass("e-selected");if((n(r).hasClass("colheader")||n(r).attr("role")=="columnheader")&&(n(this._selectedCell).hasClass("colheader")||n(this._selectedCell).attr("role")=="columnheader"))for(u=Math.min(e.split(",")[0],s.split(",")[0]);u<=Math.max(e.split(",")[0],s.split(",")[0]);u++)this.element.find("[data-p='"+u+","+e.split(",")[1]+"']").addClass("e-selected");if(o=n(this.element).find(".e-selected"),o.length>0){for(h=[],u=0;u<o.length;u++)c=n(o[u]).attr("data-p"),f=this.getJSONRecords()[parseInt(parseInt(c.split(",")[0])*this._rowCount+parseInt(c.split(",")[1]))],f.Value=n.trim(n(o[u]).text()),this.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&(f.Field=this._getFieldName(o[u])),h.push(f);t.isNullOrUndefined(this._pivotClientObj)?this._trigger("cellSelection",{JSONRecords:h}):this._pivotClientObj._trigger("cellSelection",h)}}else i.ctrlKey||n(this.element).find(".e-selected").removeClass("e-selected"),(n(r).hasClass("colheader")||n(r).hasClass("rowheader")||n(r).attr("role")=="rowheader"||n(r).attr("role")=="columnheader")&&(i.ctrlKey?n(r).toggleClass("e-selected"):n(r).addClass("e-selected"),this._selectedCell=r,this._primaryCellPos=n(r).attr("data-p"),f=this.getJSONRecords()[parseInt(parseInt(this._primaryCellPos.split(",")[0])*this._rowCount+parseInt(this._primaryCellPos.split(",")[1]))],f.Value=n.trim(n(r).text()),this.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&(f.Field=this._getFieldName(r)),i.ctrlKey||(t.isNullOrUndefined(this._pivotClientObj)?this._trigger("cellSelection",{JSONRecords:[f]}):this._pivotClientObj._trigger("cellSelection",{JSONRecords:[f]})))});t.isNullOrUndefined(this._pivotClientObj)?this._on(this.element,"click","table .e-expand,table .e-collapse",t.proxy(this._drillDown,this)):this._pivotClientObj.model.enableDeferUpdate||this._on(this.element,"click","table .e-expand,table .e-collapse",t.proxy(this._drillDown,this));this._on(this.element,"mouseover",".colheader, .rowheader, .e-expand, .e-collapse",function(t){if(t.target.className.indexOf("e-expand")>-1&&!n(t.target).hasClass("header-hover-expand"))n(t.target).addClass("header-hover-expand");else if(t.target.className.indexOf("e-collapse")>-1&&!n(t.target).hasClass("header-hover-collapse"))n(t.target).addClass("header-hover-collapse");else if((t.target.className.indexOf("e-expand")<0||t.target.className.indexOf("e-collapse")<0)&&n(t.target).children("span").length>0){var i=n(t.target).children("span")[0];!n(i).hasClass("header-hover-expand")&&i.className.indexOf("e-expand")>-1?n(i).addClass("header-hover-expand"):!n(i).hasClass("header-hover-collapse")&&i.className.indexOf("e-collapse")>-1&&n(i).addClass("header-hover-collapse")}});this._on(this.element,"mouseleave",".colheader, .rowheader, .e-expand, .e-collapse",function(){this.element.find(".e-expand, .e-collapse").removeClass("header-hover-expand header-hover-collapse")});this.model.enableToolTip&&(this._on(this.element,"mouseover",".value",this._applyToolTip),this._on(this.element,"mouseleave",".value",function(){this.model.enableToolTipAnimation?n("#"+this._id+"_gridTooltip").hide("slow"):n("#"+this._id+"_gridTooltip").hide()}));this.model.enableDrillThrough&&n.proxy(this._addHyperlink,this);this._on(this.element,"click",".filter",t.proxy(this._filterBtnClick,this));this._on(this.element,"click",".e-sorting",t.proxy(this._sortBtnClick,this));this._on(this.element,"click",".e-removeBtn",t.proxy(this.model.operationalMode==t.Pivot.OperationalMode.ServerMode?this._removePvtBtn:this._clientRemovePvtBtn,this));this._on(this.element,"click",".e-ascOrder, .e-descOrder",t.proxy(this._sortField,this));this._on(this.element,"mouseover",".e-pvtBtn",function(t){n(t.target.parentElement).addClass("e-btn e-select")});this._on(this.element,"mouseleave",".e-pvtBtn",function(t){n(t.target.parentElement).removeClass("e-btn e-select");n(t.target).removeClass("e-hoverBtn")});this._on(this.element,"mouseover",".e-pivotButton",function(t){t.target.title=t.target.textContent;n(t.target).find("button").addClass("e-hoverBtn")});this._on(this.element,"mouseleave",".e-pivotButton",function(t){n(t.target).find("button").removeClass("e-hoverBtn")});this._on(this.element,"mouseover",".filter,.e-sorting,.e-removeBtn",function(t){n(t.target.parentElement).find("button").addClass("e-hoverBtn")});this._on(this.element,"mouseleave",".filter,.e-sorting,.e-removeBtn",function(t){n(t.target.parentElement).find("button").removeClass("e-hoverBtn")});this._on(this.element,"mouseleave",".value,.rowheader,.colheader,.summary",t.proxy(function(t){var r=n(t.target).find(".cellValue").contents().filter(function(){return this.nodeType==3}),i,u;r.text()!=0&&(i=n(t.target).find(".valueSorting").length>0?!0:!1,u=i?n(t.target).find(".valueSorting"):"",n(t.target).find(".valueSorting").remove(),n(t.target).find(".cellValue").remove(),n(t.target).append(r.text()),i&&(n(t.target).hasClass("colheader")||n(t.target).hasClass("summary"))&&n(t.target).hasClass("calc")&&!n(t.target).hasClass("rowheader")?n(t.target).append(u):"")}));this._on(this.element,"click",".e-close",t.proxy(function(){this.element.find("#preventDiv").remove()}));this._on(this.element,"click",".e-dialogOkBtn",t.proxy(this._dialogOKBtnClick,this));(this.model.enableContextMenu||n(this.element).parents(".e-pivotclient").length>0&&this._pivotClientObj.model.enableToolBar&&!this._pivotClientObj.model.displaySettings.enableFullScreen)&&(this._on(this.element,"click",".e-cellSelect",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-columnResize",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-excelLikeLayout",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-advancedFiltering",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-toolTip",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-collapseByDefault",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".rtl",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-calculatedField",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-cellEditing",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-conditionalFormat",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-summaryCustomize",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-summaryTypes",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-numberFormatting",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-rowHeaderHyperLink",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-colHeaderHyperLink",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-valueCellHyperLink",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-summaryCellHyperLink",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-rowFreeze",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-colFreeze",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-excel",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-word",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-pdf",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".csv",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-normalLayout",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-normalTopSummaryLayout",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-noSummariesLayout",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-drillThrough",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".groupingBar",t.proxy(this._contextMenuClick,this)),this._on(this.element,"click",".e-frozenHeaders",t.proxy(this._createMenuIcons,this)),this._on(this.element,"click",".e-exporting",t.proxy(this._createMenuIcons,this)),this._on(this.element,"click",".e-hyperlinkOptions",t.proxy(this._createMenuIcons,this)),this._on(this.element,"click",".e-layouts",t.proxy(this._createMenuIcons,this)),n(document).click(function(t){t.target.className.indexOf("e-hyperlinkOptions")==-1&&n(".e-hyperLinkDialog").remove();t.target.className.indexOf("e-exporting")==-1&&n(".e-exportDialog").remove();t.target.className.indexOf("e-frozenHeaders")==-1&&n(".e-frozenDialog").remove();t.target.className.indexOf("e-layouts")==-1&&n(".e-layoutsDialog").remove()}));this._on(this.element,"click",".e-dialogCancelBtn",t.proxy(function(){this.element.find(".e-dialog, .e-clientDialog").hide();n("#preventDiv").remove()}));this.model.enableColumnResizing&&(this._on(this.element,"mousemove",t.proxy(function(n){this._colResizing(n)})),this._on(this.element,"mousedown","thead,.pivotGridFrozenTable,.pivotGridColValueTable",t.proxy(function(n){this._startColResizing(n)})),this._on(this.element,"mouseup",".e-reSizeColbg",t.proxy(function(n){this._endColResizing(n)})));this._on(this.element,"click",".e-nextPage, .e-prevPage, .e-firstPage, .e-lastPage",t.proxy(this._navigateTreeData,this));this._on(this.element,"click",".e-searchEditorTree",t.proxy(function(n){t.Pivot._searchEditorTreeNodes(n,this)},this));this._on(this.element,"click",".colheader,.cstot,.cgtot,.calc,.stot,.gtot",t.proxy(function(i){var f,r,o,s,e,u;if(n(i.target).hasClass("e-collapse")||n(i.target).hasClass("e-expand"))return!1;if(!t.isNullOrUndefined(this.model.valueSortSettings)&&!t.isNullOrUndefined(this.model.valueSortSettings.sortOrder)&&this.model.valueSortSettings.sortOrder!="none"&&this.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&(this.model.operationalMode==t.PivotGrid.OperationalMode.ClientMode&&this.model.dataSource.values.length>0||this.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode&&JSON.parse(this.getOlapReport()).PivotCalculations.length>0))if(f=this.model.valueSortSettings.sortOrder,r=n(i.target).hasClass("cellValue")||n(i.target).hasClass("valueSorting")||n(i.target).hasClass("e-expand")||n(i.target).hasClass("e-collapse")?n(i.target).parent():n(i.target),r.hasClass("calc")||(r=n(this.element).find("[data-p='"+(Number(r.attr("data-p").split(",")[0])+Number(r.attr("colspan"))-1)+","+(this.model.operationalMode==t.PivotGrid.OperationalMode.ClientMode?this.model.dataSource.columns.length:JSON.parse(this.getOlapReport()).PivotColumns.length)+"']")[0]),f=n(r).find(".valueSorting").length>0?n(r).find(".valueSorting").hasClass("descending")?"ascending":"descending":f,this.element.find(".valueSorting").remove(),n(r).find(".valueSorting").length!=0||n(r).hasClass("rowheader")?n(r).find(".valueSorting").removeClass("ascending").removeClass("descending").addClass(f):(o=t.buildTag("span.valueSorting e-icon "+f).css("margin-left","5px").attr("role","button").attr("aria-label","sort")[0].outerHTML,n(r).append(o)),s=JSON.stringify(this.model.customObject),t.PivotAnalysis._valueSorting=Number(n(r).attr("data-p").split(",")[0]),t.PivotAnalysis._sort=f,this.model.operationalMode==t.PivotGrid.OperationalMode.ClientMode)this.refreshControl();else{for(e="",u=0;u<this.getJSONRecords().length;u++)Number(this.getJSONRecords()[u].Index.split(",")[0])==t.PivotAnalysis._valueSorting&&Number(this.getJSONRecords()[u].Index.split(",")[1])<JSON.parse(this.getOlapReport()).PivotColumns.length+1&&(e=e==""?this.getJSONRecords()[u].Value.indexOf(".")==-1?this.getJSONRecords()[u].Value:this.getJSONRecords()[u].Value.split(".")[1]:e+this.model.valueSortSettings.headerDelimiters+(this.getJSONRecords()[u].Value.indexOf(".")==-1?this.getJSONRecords()[u].Value:this.getJSONRecords()[u].Value.split(".")[1]));this.model.valueSortSettings.index=t.PivotAnalysis._valueSorting;this.model.valueSortSettings.headerText=e;this.model.valueSortSettings.sortOrder=f;this._waitingPopup=this.element.data("ejWaitingPopup");t.isNullOrUndefined(this._waitingPopup)||this._waitingPopup.show();this.doAjaxPost("POST",this.model.url+"/"+this.model.serviceMethodSettings.valueSorting,JSON.stringify({action:"valueSorting",valueSorting:JSON.stringify(this.model.valueSortSettings),currentReport:JSON.parse(this.getOlapReport()).Report,customObject:s}),this._renderControlSuccess);delete this.model.valueSortSettings.index}}))},_navigateTreeData:function(n){t.Pivot.editorTreeNavigatee(n,this)},_stateMaintenance:function(){var i=t.buildTag("span.e-enabledState").addClass("e-icon").attr("aria-label",this._getLocalizedLabels("EnabledState"))[0].outerHTML;this.model.dataSource.enableAdvancedFilter&&(this.element.parents(".e-pivotclient").length>0?n(".e-advancedFiltering").addClass("e-enabled"):n(".e-advancedFiltering a:eq(0)").append(i));this.model.enableDrillThrough&&(n(".e-drillThrough a:eq(0)").append(i),n("#"+this._id+"contextMenu").ejMenu("disableItem",this._getLocalizedLabels("CellEditing")));this.element.parents(".e-pivotclient").length>0&&this._pivotClientObj.model.enableDrillThrough&&(this.element.find(".e-drillThrough").addClass("e-enabled"),this.element.find(".toolBar").ejToolbar("disableItemByID","cellEditing"));!this.model.enableToolTip||this.model.frozenHeaderSettings.enableFrozenRowHeaders||this.model.frozenHeaderSettings.enableFrozenColumnHeaders||(this.element.parents(".e-pivotclient").length>0?n(".e-toolTip").addClass("e-enabled"):n(".e-toolTip a:eq(0)").append(i));this.model.enableCellSelection&&(n(".e-cellSelect a:eq(0)").append(i),n("#"+this._id+"contextMenu").ejMenu("disableItem",this._getLocalizedLabels("CellEditing")));this.model.enableColumnResizing&&(this.element.parents(".e-pivotclient").length>0?(n(".e-columnResize").addClass("e-enabled"),n(".toolBar").ejToolbar("disableItemByID","collapseByDefault")):(n(".e-columnResize a:eq(0)").append(i),n("#"+this._id+"contextMenu").ejMenu("disableItem",this._getLocalizedLabels("CollapseByDefault"))));this.model.enableGroupingBar&&n(".groupingBar a:eq(0)").append(i);this.model.enableRTL&&(this.element.parents(".e-pivotclient").length>0?n(".rtl").addClass("e-enabled"):n(".rtl a:eq(0)").append(i));this.model.enableCollapseByDefault&&(this.element.parents(".e-pivotclient").length>0?(n(".toolBar").ejToolbar("disableItemByID","columnResize"),n(".e-collapseByDefault").addClass("e-enabled")):(n("#"+this._id+"contextMenu").ejMenu("disableItem",this._getLocalizedLabels("ColumnResize")),n("#"+this._id+"contextMenu").ejMenu("disableItem",this._getLocalizedLabels("FrozenHeader")),n(".e-collapseByDefault a:eq(0)").append(i)));this.model.enableCellEditing&&(this.element.parents(".e-pivotclient").length>0?(this.element.find(".e-cellEditing").addClass("e-enabled"),this.element.find(".toolBar").ejToolbar("disableItemByID","drillThrough")):n(".e-cellEditing a:eq(0)").append(i),n("#"+this._id+"contextMenu").ejMenu("disableItem",this._getLocalizedLabels("DrillThrough")),n("#"+this._id+"contextMenu").ejMenu("disableItem",this._getLocalizedLabels("CellSelection")));this.model.frozenHeaderSettings.enableFrozenRowHeaders&&n("li#row a:eq(0)").append(i);this.model.frozenHeaderSettings.enableFrozenColumnHeaders&&n("li#column a:eq(0)").append(i);this.model.hyperlinkSettings.enableRowHeaderHyperlink&&n("li#rowHeader a:eq(0)").append(i);this.model.hyperlinkSettings.enableColumnHeaderHyperlink&&n("li#columnHeader a:eq(0)").append(i);this.model.hyperlinkS