Ext.define("ReportBuilder.controller.BuilderController",{extend:"Ext.app.Controller",views:["Main"],method:null,init:function(){this.control({});},invokeSettings:function(c){isSettingsEnabled=true;var b=this;var a=new Ext.XTemplate('<div style="float:left;margin:0px 0px 0px 0px;">'+settings+'</div><div style="text-align:right;float:right;"><div class="iconCloseNew" id="closeSettings"></div></div>');
Ext.create("Ext.container.Container",{width:565,id:"configMod",ui:"settingsWindowContainer",items:[{xtype:"container",cls:"configMode_popupArrow",style:{"top":"-14px","left":"355px"}},{xtype:"container",html:a.apply(),cls:"containerHeader",style:{"top":"0px","margin":"0px"}},{xtype:"buildersettings"}],onRender:function(){b.getNewUtilities().loadIcon(true,true,true,false,true,true,true,false,false,false,true);
Ext.getCmp("bookletTool").setDisabled(true);Ext.getCmp("favoriteTool").setDisabled(true);Ext.getCmp("scheduleTool").setDisabled(true);Ext.getCmp("saveTool").setDisabled(true);Ext.getCmp("mailTool").setDisabled(true);Ext.getCmp("printTool").setDisabled(true);Ext.getCmp("csvTool").setDisabled(true);Ext.get("closeSettings").on("click",function(){b.validateAndCloseSettings();
});if(appConstants.fromFavouriteModify=="Yes"||appConstants.fromScheduleModify=="Yes"){Ext.getCmp("reportGeneration").setDisabled(true);}},renderTo:"main"});},validateAndCloseSettings:function(){if(this.validateSettings()){Ext.get("configMod").animate({duration:500,to:{y:-500}});return true;}},closeSettingAndSubmit:function(){if(this.validateAndCloseSettings()){this.beforeSubmit(Ext.getCmp("submit"),true);
}},validateSettings:function(){var e=true;var b=Ext.getCmp("reportGeneration").getValue();var h=Ext.getCmp("timefrom").getValue();var f=Ext.getCmp("minfrom").getValue();var k=Ext.getCmp("timeto").getValue();var m=Ext.getCmp("minto").getValue();var c=Ext.getCmp("er_stdate").getValue();if(c!=null){c.setHours(Ext.getCmp("er_sthr").getValue());
var g=Ext.getCmp("er_enddate").getValue();if(g!=null){g.setHours(Ext.getCmp("er_endhr").getValue());}var n=checkDateTime(c,g);if(!n){return;}if(!checkTimePeriod(h,f,k,m)){e=false;}var j=Ext.getCmp("rangeSettingsItemsId");if(!j.isHidden()&&j.items!=undefined){for(var d=0;d<j.items.length;d++){var a=Ext.getCmp("dynamicRangeCombo_"+d).getValue();
if(a!="None"){if(Ext.getCmp("disp_MeasureName"+d).getValue()==""||Ext.getCmp("disp_MeasureName"+d).getValue()=="."){Ext.Msg.show({title:"Alert",msg:_checkempty,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});return false;}}}}if(b!=null&&(b=="background"||b=="background-csv")){var l=Ext.getCmp("bgReportName").getValue();
if(!validateTextBoxWithSpecialChars(l,"Attachment",true)){e=false;}}}return e;},callAjax:function(a,f,d,b,e){f+="&tempDesc="+appConstants.tempDesc;if(this.method=="submit"){timelineurl="/final/reporter/ErReportBuilderDrillDown.jsp?"+f+"&isSubmit=true";}distributedPieUrl=this.getQueryString(false);var c=this;
Ext.Ajax.request({url:a,params:f,async:d,scope:this,success:function(g){if(g.responseText.length>0){appConstants.builderJson=Ext.decode(g.responseText);c.onAjaxSuccess(b,e);}},failure:function(g){Ext.MessageBox.alert("Error occured in ErReportBuilder.jsp page");}});},getForeGroundDataPanel:function(b){var a=this;
if(Ext.get("lblTool")==null){}var c=new Ext.panel.Panel({id:"tableCont",padding:0,margin:10,scroll:true,autoScroll:true,border:false,frame:false,html:b,listeners:{}});return c;},getheatMapInHTml:function(h){var f;f='<div class="newTable" style="border:0px solid red;height:100%">';f+='<table border="0" id="heatMaphtml" align="center" width="100%" valign="top">';
f+="<thead>";f+="<tr>";f+='<th  align="center" >'+""+"</th>";for(var e=0;e<h.xAxisLabel.length;e++){f+='<th  align="center" >'+h.xAxisLabel[e]+"</th>";}f+="</tr>";f+="</thead>";f+="<tbody>";for(var c=0;c<h.DataSet.length;c++){var d=h.DataSet[c];f+="<tr>";f+="<td>"+d.name;f+="</td>";var b="green";for(var a=0;
a<d.data.length;a++){var g=d.data[a];if(g.indexOf("$$")>-1){b=g.substring(g.indexOf("$$")+2);g=g.substring(0,g.indexOf("$$"));}f+='<td  align="center" style="background-color:'+b+'" >';f+='<span  class="font_bold11">'+g+"</span>";f+="</td>";}f+="</tr>";}f+="</tbody>";f+="</table>";f+="</div>";return f;
},loadWidgetData:function(d,o,j,m,b,g){if(m=="heatMap"){g=g-70;var k;if(o.DataSet==""||o.DataSet==undefined||o.DataSet=="null"){k='<div class="egFlexCenterByColumnWise" style="height:100%"> <div class="iconInformation"></div> <div class="commonErrorMsgText">No Measures Available!</div> </div>';}else{k=appConstants.appObj.getController(appConstants.appController).getheatMapInHTml(o);
}var f=this.getForeGroundDataPanel(k);return f;}appConstants.chartType="highchart";var c=[];var i={};if(m=="table"||m=="topn"){if(o!=undefined&&o.gridData.length>0){if(o.gridColums instanceof Array){i=this.getGrid(d,o,o.title,b,g,o.enableSymbolImageTd,o.enableCursorTd,o.needtoFixColumn);}else{var l=Ext.getCmp("multisort");
if(appConstants.gridMultiSortEnable!=undefined&&appConstants.gridMultiSortEnable=="yes"&&l!=undefined&&l.getValue()==true){i=this.getMutlSortGrid1(d,o,o.title,b,g,o.enableSymbolImageTd,o.enableCursorTd);}else{if(o!=undefined&&o.rowExpander!=undefined&&o.rowExpander=="yes"){i=this.getGridWithRowExpander(d,o,o.title,b,g,o.enableSymbolImageTd,o.enableCursorTd);
}else{i=this.getGridWithSubCol(d,o,o.title,b,g,o.enableSymbolImageTd,o.enableCursorTd);}}}}else{i=this.getNoMeasureWithoutBorder();}}else{if(m=="tableWithMergingColumns"){i=this.loadTableWithMergingColumns(d,o,o.title,b,g,o.enableSymbolImageTd,o.enableCursorTd,o.needtoFixColumn);}else{if(m!="timeline"&&m!="line"&&o.ShowLegendinTableFormatforUI==undefined){if(m=="bar"){var e=o.chartHeight;
if(e!=undefined){var h=o.DataSet;if(h!=undefined&&h.length>0&&e>300){g=e;Ext.getCmp(d).setAutoScroll(true);}}}g=g-40;var n=true;if(o.chartType=="combinedChart"){n=false;}if(appConstants.fromReportBuilder!=undefined&&appConstants.fromReportBuilder=="true"){g=g-30;}i={xtype:"container",data:o,sortable:true,margin:10,padding:0,scroll:true,autoScroll:n,height:g,closeAction:"destroy",html:'<div id="'+d+'_chart" style="height:'+g+'px;"> </div>',listeners:{"boxready":function(u){try{var t=o;
if(m=="distpie"){highChartPieHeight=g-80;appConstants.erUtils.updateDistributedPieChart(j,0,appConstants.chartType,t,"pieColors","urlLinks","pieLabels","",t.XML,t.swfpath,t,this);}else{if(m=="pie"){highChartPieHeight=g-25;if(highChartPieHeight>270){highChartPieHeight=270;}appConstants.erUtils.updatePieChart_builder(appConstants.chartType,t,"pieColors","urlLinks","pieLabels","",t.XML,t.swfpath,t,this);
}else{if(this.data.chartType=="combinedChart"&&this.data.multiAxis!=undefined&&this.data.multiAxis){if(m=="bar"){if(t.chartHeight>g){g=t.chartHeight;}}var r={};r=jQuery.extend(true,{},getHighChartsBarInstance_combine(d+"_chart",g-20,t.chartWidth),r);r.setData(t,"<%=currentDateFormat%>","");r.drawChart();
}else{var r={};r=jQuery.extend(true,{},getHighChartsBarInstance(d+"_chart",t,"",""),r);r.setData(t,"<%=currentDateFormat%>","");r.drawChart();}}}}catch(s){}}}};}else{g=g-40;var a=g-75;var p=o["isSharePointContentReport"];if(p!=undefined||p!="undefind"&&p=="true"){a=a+65;}var q=o["isLoadEvaluatorReport"];
if(q!=undefined||q!="undefined"&&q=="true"){a=a+75;}i={xtype:"container",layout:{type:"vbox",align:"stretch"},height:g,padding:"0 0 10 0",items:[{xtype:"container",data:o,sortable:true,margin:"0 10 0 10",padding:0,autoScroll:false,id:d+"_chart_GraphPanel",html:'<div id="'+d+'_chart" style="height:'+a+'px"> </div>',closeAction:"destroy",height:a,listeners:{"boxready":function(u){try{var t=o;
if(m=="timeline"&&this.data.hasMonthOrWeekGroup=="yes"){var r={};r=jQuery.extend(true,{},getHighChartsInstance(d+"_chart","",""),r);r.setData(t,"MMM dd, yyyy","");r.drawChart();}else{if(m=="combinedChart"&&o.ShowLegendinTableFormatforUI!=undefined){var r={};r=jQuery.extend(true,{},getHighChartsInstance_combined(d+"_chart",g-75,t.chartWidth),r);
r.setData(t,t.currentDateFormat,"");r.drawChart();}else{if(m=="bar"){if(t.chartHeight>g){g=t.chartHeight-20;}}var r={};r=jQuery.extend(true,{},getHighChartsBarInstance(d+"_chart",t,"",""),r);r.setData(t,"<%=currentDateFormat%>","");r.drawChart();}}}catch(s){console.log("e::"+s);}}}},{xtype:"container",margin:"5 0 5 0",id:d+"_chart_legendPanel",height:55,style:{"overflow":"hidden","padding-top":"2px","padding-right":"10px","padding-bottom":"2px",}}]};
}}}return i;},loadOverAllPageNavigation:function(n,b,h){var m=this;var i=Ext.getCmp(h);var l=b["isRangeNeed"];var a=parseInt(b["dataPageNo"]);var d=parseInt(b["overAllRecCount"]);var k=parseInt(b["recordPerPage"]);var c=((a-1)*Math.ceil(k/gridPageSize))+1;if(fromPerBtn){c=c+activePage-1;}if(l!="true"&&a==1){return;
}else{var o=false;var g=false;var j=Math.ceil(d/gridPageSize);if(a==1&&c==1){g=true;}if(c==j){o=true;}var f='<div style="text-align:center;font-size:10px;">Page &nbsp;<input class="htmlPaginationTextfield" type="text" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="'+c+'" value="'+c+'" size="1" style="width:25px;height:15px;text-align:center;font-size:10px"/> &nbsp; of '+j+"<div>";
var e='<div style="text-align:right;font-size:10px;">Total Records: '+d+"</div>";appConstants.totalRec=d;i.add({xtype:"container",cls:"htmlPaginationOuter",height:35,layout:"column",margin:"0 10 10 10",padding:"10 0 10 0",items:[{xtype:"container",layout:"hbox",columnWidth:0.5,margin:"0 0 10 0",items:[{xtype:"container",width:48,margin:"0 0 10 5",items:[{xtype:"button",id:"firstPageBtn"+n,tooltip:"<b>First Page</b>",iconCls:"al_first_enabled",style:{background:"none",border:"0px"},margin:"0 3 0 0",currentPage:a,disabled:g,listeners:{click:function(){fromPerBtn=false;
var r=Ext.getCmp(n);var p=Ext.getCmp("infolabel"+n);var q=r.store.currentPage-1;if(q==0&&a==1){return;}p.update('<div style="text-align:center;font-size:10px;">Page &nbsp;<input type="text" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="'+1+'" value="'+1+'" size="1" style="width:25px;height:15px;text-align:center;font-size:10px"/> &nbsp; of '+j+"<div>");
if(a>1){Ext.getCmp("main").show();appConstants.currentPage=1;keepResult=true;appConstants.appObj.getController(appConstants.appController).gridCustomPaging(i.up("panel"));}else{Ext.getCmp("firstPageBtn"+n).setDisabled(true);Ext.getCmp("customPer"+n).setDisabled(true);Ext.getCmp("customNext"+n).setDisabled(false);
Ext.getCmp("lastPageBtn"+n).setDisabled(false);if(r.fireEvent("beforechange",r,q)!==false){r.store.loadPage(1);}}}}},{xtype:"button",iconCls:"al_previous_enabled",style:{background:"none",border:"0px"},id:"customPer"+n,tooltip:"<b>Previous Page</b>",currentPage:a,disabled:g,listeners:{click:function(){fromPerBtn=false;
var s=Ext.getCmp(n);var q=Ext.getCmp("infolabel"+n);var r=s.store.currentPage-1;if(r==0&&a==1){return;}var p=((a-1)*Math.ceil(k/gridPageSize))+r;q.update('<div style="text-align:center;font-size:10px;">Page &nbsp;<input type="text" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="'+p+'" value="'+p+'" size="1" style="width:25px;height:15px;text-align:center;font-size:10px"/> &nbsp; of '+j+"<div>");
if(r==0&&a>1){Ext.getCmp("main").show();fromPerBtn=true;appConstants.currentPage=this.currentPage-1;keepResult=true;appConstants.appObj.getController(appConstants.appController).gridCustomPaging(i.up("panel"));}else{if(p==1){Ext.getCmp("customPer"+n).setDisabled(true);Ext.getCmp("firstPageBtn"+n).setDisabled(true);
}Ext.getCmp("customNext"+n).setDisabled(false);Ext.getCmp("lastPageBtn"+n).setDisabled(false);if(s.fireEvent("beforechange",s,r)!==false){s.store.loadPage(r);}}}}}]},{xtype:"tbseparator",},{xtype:"label",width:101,id:"infolabel"+n,html:f},{xtype:"tbseparator",},{xtype:"container",margin:"0 0 10 0",width:48,items:[{xtype:"button",iconCls:"al_next_enabled",style:{background:"none",border:"0px"},id:"customNext"+n,tooltip:"<b>Next Page</b>",margin:"0 3 0 0",currentPage:a,disabled:o,listeners:{"click":function(){fromPerBtn=false;
var s=Ext.getCmp(n);var q=Ext.getCmp("infolabel"+n);var r=s.store.currentPage+1;var p=((a-1)*Math.ceil(k/gridPageSize))+r;if(p>j){return;}q.update('<div style="text-align:center;font-size:10px;">Page &nbsp;<input type="text" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="'+p+'" value="'+p+'" size="1" style="width:25px;height:15px;text-align:center;font-size:10px"/> &nbsp; of '+j+"<div>");
if(r<=Math.ceil(k/gridPageSize)){Ext.getCmp("customPer"+n).setDisabled(false);Ext.getCmp("firstPageBtn"+n).setDisabled(false);if(p==j){Ext.getCmp("customNext"+n).setDisabled(true);Ext.getCmp("lastPageBtn"+n).setDisabled(true);}if(s.fireEvent("beforechange",s,r)!==false){s.store.nextPage();}}else{Ext.getCmp("main").show();
appConstants.currentPage=this.currentPage+1;keepResult=true;appConstants.appObj.getController(appConstants.appController).gridCustomPaging(i.up("panel"));}}}},{xtype:"button",iconCls:"al_last_enabled",style:{background:"none",border:"0px"},id:"lastPageBtn"+n,tooltip:"<b>Last Page</b>",currentPage:a,disabled:o,listeners:{"click":function(){fromPerBtn=true;
var s=Ext.getCmp(n);var q=Ext.getCmp("infolabel"+n);var r=Math.ceil(s.store.totalCount/gridPageSize);var p=((a-1)*Math.ceil(k/gridPageSize))+r;if(p>j){return;}q.update('<div style="text-align:center;font-size:10px;">Page &nbsp;<input type="text" onkeypress="return event.charCode >= 48 && event.charCode <= 57" name="'+j+'" value="'+j+'" size="1" style="width:25px;height:15px;text-align:center;font-size:10px"/> &nbsp; of '+j+"<div>");
if(a==Math.ceil(d/k)){Ext.getCmp("customPer"+n).setDisabled(false);Ext.getCmp("firstPageBtn"+n).setDisabled(false);Ext.getCmp("customNext"+n).setDisabled(true);Ext.getCmp("lastPageBtn"+n).setDisabled(true);if(s.fireEvent("beforechange",s,r)!==false){s.store.loadPage(r);}}else{Ext.getCmp("main").show();
appConstants.currentPage=Math.ceil(d/k);keepResult=true;appConstants.appObj.getController(appConstants.appController).gridCustomPaging(i.up("panel"));}}}}]},{xtype:"tbseparator",},{xtype:"container",width:25,margin:"0 0 10 0",items:[{xtype:"button",style:{background:"none",border:"0px"},margin:"0 0 0 0",currentPage:a,listeners:{click:function(){var r=Ext.getCmp(n);
var p=Ext.getCmp("infolabel"+n);var q=r.store.currentPage;if(r.fireEvent("beforechange",r,q)!==false){r.store.loadPage(q);}}}}]}]},{xtype:"container",margin:"0 0 0 0",columnWidth:0.5,layout:{type:"hbox",pack:"end"},items:{xtype:"label",html:e}}]});}},getMutlSortGrid1:function(I,v,y,x,n,M,g){var t=0;var k=0;
var O=0;var B=v.gridColums;var P=v.gridData;var R=v.customWidth;var u=new Array();var L=new Array();var L=new Array();var F=0;var o=this;var b=10;for(var p in B){var C=p;var w=B[p];var N;if(R!=undefined&&R[F]!=""){N=parseFloat(R[F]);}else{N="";}if(w.length>0){var r=new Array();for(var A in w){var D=w[A];
var l=D+(F++);u.push({name:l,type:"float"});r.push({header:D,align:"left",dataIndex:l,sortable:false,renderer:function(aa,T,W,ae,U,ab,c){aa=""+aa;if(aa.indexOf("~DD")>-1){var ac=aa.substring(0,aa.indexOf("~DD"));var f=aa.substring(aa.indexOf("~DD")+3);aa='<span class="decimal-align"><a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:window.open(\''+f+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+ac+"</a></span>";
return aa;}var X="";var Z="no";var V="";if(M){if(aa.indexOf("@@")!=-1){X=aa.substring(aa.indexOf("@@")+2);aa=aa.substring(0,aa.indexOf("@@"));Z="yes";}if(aa.indexOf("$$")!=-1){V=aa.substring(aa.indexOf("$$")+2);aa=aa.substring(0,aa.indexOf("$$"));}}if(aa.indexOf("%")>-1){T.tdAttr="";}else{T.tdAttr='data-qclass=yellowTip data-qtip="'+aa.trim()+'"';
}var ad="";var Y="";if(!isNaN(aa)&&!isNaN(parseFloat(aa))||aa=="-"){if(aa!=null&&aa.indexOf(".")>-1){ad=aa.substring(aa.indexOf("."));Y=aa.substring(0,aa.indexOf("."));if(Z=="yes"&&M){aa='<table><tr><td class="'+X+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+Y+'</span><span class="decimal-align2">'+ad+"</span></td></tr></table>";
}else{if(M){aa='<span class="decimal-align" style="background:'+V+'">'+Y+'</span><span class="decimal-align2" style="background:'+V+'">'+ad+"</span>";}else{aa='<span class="decimal-align">'+Y+'</span><span class="decimal-align2">'+ad+"</span>";}}}else{if(Z=="yes"&&M){aa='<table><tr><td class="'+X+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+aa+"</span></td></tr></table>";
}else{if(M){aa='<span class="decimal-align" style="background:'+V+'">'+aa+"</span>";}else{aa='<span class="decimal-align">'+aa+"</span>";}}}}return aa;},listeners:{headerclick:function(V,T,W,aa,X){var f=Ext.getCmp("er_sortingColumn");if(f!=undefined){var U=T.text;if(!Ext.isEmpty(f.getStore())&&!Ext.isEmpty(f)){if(U!=undefined&&U=="Error"){U+=" (%)";
}var Z=f.getStore().findExact("displayField",U,0);if(Z!=undefined&&Z!=-1){var c=f.getStore().getAt(Z);var Y=c.get("valueField");if(f.getValue()!=undefined&&f.getValue()!=Y){f.setValue(Y);if(!keepResult){appConstants.totalRec=0;appConstants.currentPage=1;}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(this.up("panel"));
}}}}}}});}L.push({header:p,dataIndex:p,sortable:false,columns:r,});}else{var Q=0;var l=p+(F++);if(F==1){u.push({name:l});}else{u.push({name:l,type:"float"});}var E="left";L.push({header:p,sortable:false,align:E,dataIndex:l,customWidth:N,renderer:function(aa,f,W,ad,U,ab,c){aa=""+aa;var T="";if(c.ownerCt.columns[U]!=undefined&&c.ownerCt.columns[U].dataIndex.indexOf("Components")==0&&g){f.style="cursor: pointer;";
T="forCursorSymbol";}if(aa.indexOf("%")>-1){f.tdAttr="";}else{if(aa.indexOf(" week")>-1){aa=o.getDataForWeekGroup(aa);f.tdAttr='data-qclass=yellowTip data-qtip="'+aa.trim()+'"';}else{f.tdAttr='data-qclass=yellowTip data-qtip="'+aa.trim()+'"';}}var X="";var Z="no";var V="";if(M){if(aa.indexOf("@@")!=-1){X=aa.substring(aa.indexOf("@@")+2);
aa=aa.substring(0,aa.indexOf("@@"));Z="yes";}if(aa.indexOf("$$")!=-1){V=aa.substring(aa.indexOf("$$")+2);aa=aa.substring(0,aa.indexOf("$$"));}}var ac="";var Y="";if(!isNaN(aa)&&!isNaN(parseFloat(aa))||aa=="-"){if(aa!=null&&aa.indexOf(".")>-1){ac=aa.substring(aa.indexOf("."));Y=aa.substring(0,aa.indexOf("."));
if(Z=="yes"&&M){aa='<table><tr><td class="'+X+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+Y+'</span><span class="decimal-align2">'+ac+"</span></td></tr></table>";}else{if(M){aa='<span class="decimal-align" style="background:'+V+'">'+Y+'</span><span class="decimal-align2" style="background:'+V+'">'+ac+"</span>";
}else{aa='<span class="decimal-align">'+Y+'</span><span class="decimal-align2">'+ac+"</span>";}}}else{if(Z=="yes"&&M){aa='<table><tr><td class="'+X+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+aa+"</span></td></tr></table>";}else{if(M){aa='<span class="decimal-align" style="background:'+V+'">'+aa+"</span>";
}else{aa='<span class="decimal-align">'+aa+"</span>";}}}}if(g){aa='<div class="'+T+'">'+aa+"</div>";}return aa;},listeners:{headerclick:function(V,T,W,aa,X){var f=Ext.getCmp("er_sortingColumn");if(f!=undefined){var U=T.text;if(!Ext.isEmpty(f.getStore())&&!Ext.isEmpty(f)){var Z=f.getStore().findExact("displayField",U,0);
if(Z!=undefined&&Z!=-1){var c=f.getStore().getAt(Z);var Y=c.get("valueField");if(f.getValue()!=undefined&&f.getValue()!=Y){f.setValue(Y);if(!keepResult){appConstants.totalRec=0;appConstants.currentPage=1;}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(this.up("panel"));
Q++;}}}}}}});}O++;}var m=Ext.create("Ext.ux.BoxReorderer",{listeners:{scope:this,Drop:function(ab,aj,f){if(q.items!=undefined){var X=q.items.items;for(var Y=0;Y<X.length;Y++){var U=X[Y];if(U.sortData!=undefined){if(Y==1){var ag=Ext.getCmp("er_sortingColumn");if(!Ext.isEmpty(ag.getStore())&&!Ext.isEmpty(ag)){var ad=U.text;
var V=ag.getStore().findExact("displayField",ad,0);if(V!=undefined&&V!=-1){var ae=ag.getStore().getAt(V);var ac=ae.get("valueField");if(ag.getValue()!=undefined&&ag.getValue()!=ac){ag.setValue(ac);appConstants.er_sortingColumnState=U.sortData.direction;appConstants.er_primaryIconCls=U.iconCls;}}}}if(Y==2){var ag=Ext.getCmp("er_secondaryColSort");
if(!Ext.isEmpty(ag.getStore())&&!Ext.isEmpty(ag)){var ad=U.text;var V=ag.getStore().findExact("displayField",ad,0);if(V!=undefined&&V!=-1){var ae=ag.getStore().getAt(V);var ac=ae.get("valueField");if(ag.getValue()!=undefined&&ag.getValue()!=ac){ag.setValue(ac);appConstants.er_secondaryColSortState=U.sortData.direction;
appConstants.er_secondaryIconCls=U.iconCls;}}}}}}}if(!keepResult){appConstants.totalRec=0;appConstants.currentPage=1;}var T=q.up("panel");var ah=T.id;var aa=Ext.getCmp(ah);var af=new Ext.LoadMask(aa.getEl(),{msg:"Loading ..."});af.show();var W="/final/reporter/ReportBuilderController.jsp";var ai=ah.substring(0,ah.indexOf("_"));
if(ai.indexOf("customgridId")!=-1){ai=ai.substring(ai.indexOf("customgridId")+12);}keepResult=true;var Z=o.ajaxQueryMaker(Ext.getCmp("submit"));Z+="&widget="+ai;Z+="&tempDesc="+appConstants.tempDesc;document.getElementById("resultcontainer-innerCt").innerHTML="";o.callAjax(W,Z+"&widget="+ai,false,false,true);
af.hide();},}});var i=Ext.create("Ext.ux.ToolbarDroppable",{});gridPageSize=b;var e=Ext.create("Ext.data.ArrayStore",{fields:u,proxy:{type:"pagingmemory",reader:{type:"array"}},pageSize:gridPageSize,remoteSort:true,sortable:false,autoLoad:true,data:P,});var d=Ext.getCmp("er_sortingColumn").getValue();
var G=Ext.getCmp("er_sortingColumn").getRawValue();if(d!=undefined&&d.indexOf("$")!=-1){var z=d.substring(d.indexOf("$")+1);d=G+z;}var a=Ext.getCmp("er_secondaryColSort").getValue();var j=Ext.getCmp("er_secondaryColSort").getRawValue();if(a!=undefined&&a.indexOf("$")!=-1){var z=a.substring(a.indexOf("$")+1);
a=j+z;}var q=Ext.create("Ext.toolbar.Toolbar",{items:[{xtype:"tbtext",text:"Sorting order:",reorderable:false},{xtype:"button",text:G,sortData:{property:d,direction:appConstants.er_sortingColumnState},iconCls:appConstants.er_primaryIconCls,reorderable:true,listeners:{click:function(V,W){var c=V.sortData,U=V.iconCls;
if(c){var Y=V.text;if(!keepResult){appConstants.totalRec=0;appConstants.currentPage=1;}appConstants.er_sortingColumnState=Ext.String.toggle(V.sortData.direction,"ASC","DESC");appConstants.er_primaryIconCls=Ext.String.toggle(U,"sort-asc","sort-desc");if(q.items!=undefined){var X=q.items.items;for(var T=0;
T<X.length;T++){var f=X[T];if(f.sortData!=undefined&&f.text!=Y){appConstants.er_secondaryColSortState=f.sortData.direction;}}}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(this.up("panel"));}}}},{xtype:"button",text:j,sortData:{property:a,direction:appConstants.er_secondaryColSortState},iconCls:appConstants.er_secondaryIconCls,reorderable:true,listeners:{click:function(V,W){var c=V.sortData,U=V.iconCls;
if(c){var Y=V.text;if(!keepResult){appConstants.totalRec=0;appConstants.currentPage=1;}appConstants.er_secondaryColSortState=Ext.String.toggle(V.sortData.direction,"ASC","DESC");appConstants.er_secondaryIconCls=Ext.String.toggle(U,"sort-asc","sort-desc");if(q.items!=undefined){var X=q.items.items;for(var T=0;
T<X.length;T++){var f=X[T];if(f.sortData!=undefined&&f.text!=Y){appConstants.er_sortingColumnState=f.sortData.direction;}}}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(this.up("panel"));}}}},{xtype:"button",id:"multisortNew",cls:"iconMoreOptions",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"Multi Sort"});
},click:function(){var W=Ext.getCmp("er_sortingColumn");var Y=Ext.getCmp("er_secondaryColSort");var T=[];if(appConstants.builderJson.combo!=undefined){var X=appConstants.builderJson.combo.sortingColumnCombo;if(X!=undefined){for(var V=0;V<X.length;V++){var f=X[V];var aa=f.displayField;var Z=f.valueField;
var U=false;if(Z==W.getValue()||Z==Y.getValue()){U=true;}T.push({xtype:"checkbox",cls:"checkbt",boxLabel:aa,name:aa,inputValue:Z,checked:U,});}}}Ext.create("Ext.window.Window",{title:"Multi Sorting Column",width:400,border:false,frame:false,modal:true,ghost:false,height:280,listeners:{show:function(ab){if(this.modal){var ac=Ext.dom.Query.select(".x-mask");
for(var ad=0;ad<ac.length;ad++){var c=Ext.fly(ac[ad]);c.addCls("windowModal");}}},hide:function(ab){var ac=Ext.dom.Query.select(".x-mask");if(this.modal){var c=Ext.fly(ac[0]);c.removeCls("windowModal");}},afterrender:function(){Ext.EventManager.onWindowResize(function(){var c=this;c.center();},this);
}},items:[{xtype:"panel",autoScroll:true,scroll:true,height:270,autoHeight:true,style:{"overflow-x":"hidden"},id:"chekboxAllCol",items:[{xtype:"checkboxgroup",columns:2,vertical:true,width:"100%",margin:"10px",id:"multiColchkboxgroup",items:T,listeners:{change:function(ac,ad){if(Object.keys(ad).length>2){var ab=1;
for(var ae in ad){if(ad.hasOwnProperty(ae)){var c=Ext.ComponentQuery.query("[name="+ae+"]");if(ab==1){var ag=c[0].id;var af=Ext.getCmp(ag);af.setValue(false);}ab++;}}}}}}]}],buttonAlign:"center",buttons:[{text:"Update",id:"multisortSelectId",cls:"quickMenuWhiteButton",handler:function(ab){var ac=Ext.getCmp("multiColchkboxgroup").getChecked();
var c=Ext.getCmp("multisort");if(ac.length>1){appConstants.gridMultiSortEnable="yes";c.setValue(true);}else{appConstants.gridMultiSortEnable="no";c.setValue(false);}Ext.each(ac,function(ae,ad){if(ad==0){W.setValue(ae.getSubmitValue());}else{if(ad==1){Y.setValue(ae.getSubmitValue());}}});if(!keepResult){appConstants.totalRec=0;
appConstants.currentPage=1;}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(q.up("panel"));this.up("window").destroy();}}],}).show();}},}],plugins:[m,i]});var s=true;var K=8;if(x>1000){var h=x-1000;var H=Ext.util.Format.round((h/100),0);K=K+H;}var J=true;
if(K<u.length){J=false;}if(gridPageSize<P.length){s=false;}if(customPaging){s=true;}if(fromPerBtn){activePage=Math.ceil(P.length/gridPageSize);}var S=[];S.push({xtype:"customgrid_builder",tbar:q,store:e,columns:L,id:"customgridId"+I,padding:0,margin:10,frame:false,autoScroll:true,stripeRows:true,needtoFixColumn:true,popUpData:"noToolTip",scroll:false,ui:"newGridPanel",border:true,layout:{type:"vbox",align:"stretch"},flex:1,listeners:{scope:this,single:true,afterlayout:function(T){var U=[];
if(q.items!=undefined){var V=q.items.items;for(var f=0;f<V.length;f++){var c=V[f];if(c.sortData!=undefined){U.push(c.sortData);}}}e.sort(U);},},dockedItems:[{xtype:"pagingtoolbar",cls:"newPagination",dock:"bottom",displayInfo:true,store:e,id:"pageingTool"+I,hidden:s,displayInfo:true,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No Data to display",listeners:{change:function(c,f){}}}],});
S.push({xtype:"container",id:"customPageinationId"+I,margin:"0 0 0 0",layout:{type:"vbox",align:"stretch"},flex:1,});return{xtype:"container",id:"containerr"+I,layout:{type:"vbox",align:"stretch"},flex:1,items:S};},getGridWithRowExpander:function(M,w,y,x,k,R,d){var g=w.sortIndex;var I="DESC";if(w.sortOrderStatus!=undefined){I=w.sortOrderStatus;
}var T=w.gridData;var a=10;if(k>120){a=k-60-75;a=a/24;a=Ext.util.Format.round(a,0);}gridPageSize=a;var z=new Array();var F=new Array();var r=new Array();if(!Ext.isEmpty(w.gridColums)&&w.gridColums!=undefined){var J=0;for(var n in w.gridColums){z[J]=n;J++;}}var j=new Array();var L=new Array();var t=false;
if(T!=undefined&&T[0]!=undefined&&T[0].subColumnDatas!=undefined&&T[0].subColumnHeader!=undefined){for(var E in T){var D=T[E];if(D!=undefined&&D.subColumnDatas!=undefined&&D.subColumnHeader!=undefined){var G=D.subColumnHeader;var h="data"+M+E;var C='<div class="newTable"><table width="100%" id="'+h+'"><thead><tr>';
for(var p in G){var i=G[p];var A;if(i!=null&&i.indexOf("~")!=-1){A=i.substring(i.indexOf("~")+1);A=parseFloat(A);i=i.substring(0,i.indexOf("~"));}C+="<th width="+A+">"+i+"</th>";}C+="</tr></thead><tbody>";var H=D.subColumnDatas;for(var B in H){var N=H[B];C+="<tr>";for(var p in G){var l=G[p];var A;if(l!=undefined&&l.indexOf("~")!=-1){A=l.substring(l.indexOf("~")+1);
A=parseFloat(A);l=l.substring(0,l.indexOf("~"));}var U=N[l];if(U!=undefined&&U.indexOf("~DDLink")>-1){var v=U.substring(0,U.indexOf("~DDLink"));var f=U.substring(U.indexOf("~DDLink")+7);U='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:window.open(\''+f+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+v+"</a>";
}else{if(U!=undefined&&U.indexOf("~DD")>-1){var v=U.substring(0,U.indexOf("~DD"));var f=U.substring(U.indexOf("~DD")+3);U='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:parent.printWindowFnWithHeaderBuilder(\''+f+"','Detail');\" >"+v+"</a>";}}C+='<td style="max-width:450px;word-break: break-all;" width='+A+">"+U+"</td>";
}C+="</tr>";}C+="</tbody></table></div>";T[E]["userDetailList"]=C;}}}else{}z[J]="userDetailList";var b=Ext.create("Ext.data.Store",{fields:z,data:T,pageSize:gridPageSize,autoLoad:true,remoteSort:true,proxy:{type:"pagingmemory"}});var o=new Array();for(var u in w.gridColums){var Q=w.gridColLanguageObj[u];
var S;if(Q!=undefined&&Q.indexOf("~")!=-1){S=parseFloat(Q.substring(Q.indexOf("~")+1));Q=Q.substring(0,Q.indexOf("~"));}else{S=200;}o.push({header:Q,sortable:true,dataIndex:u,align:"left",customWidth:S,renderer:function(aa,X,Z,ad,Y,ab,s){if(aa!=undefined&&aa.indexOf("eGTilteG")>-1){aa=aa.replace("eGTilteG","~");
}if(aa.indexOf("~DDLink")>-1){var ac=aa.substring(0,aa.indexOf("~DDLink"));var W=aa.substring(aa.indexOf("~DDLink")+7);aa='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+W+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+ac+"</a>";
return aa;}else{if(aa.indexOf("~DD")>-1){var ac=aa.substring(0,aa.indexOf("~DD"));var W=aa.substring(aa.indexOf("~DD")+3);aa='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:parent.printWindowFnWithHeaderBuilder(\''+W+"','Detail');\" >"+ac+"</a>";return aa;}}return aa;},doSort:function(W){var s=this.up("grid").store;
var X=this.getSortParam();s.sort({property:X,direction:W,sorterFn:function(Z,Y){Z=Z.get(X);Y=Y.get(X);if(Z.indexOf("~DD")!=-1){Z=Z.substring(0,Z.indexOf("~DD"));}if(Y.indexOf("~DD")!=-1){Y=Y.substring(0,Y.indexOf("~DD"));}if(!isNaN(Z)&&!isNaN(Y)){Z=Ext.isNumber(Z)?Z:parseFloat(String(Z),10);Y=Ext.isNumber(Y)?Y:parseFloat(String(Y),10);
if(W=="ASC"){Z=isNaN(Z)?999999:Z;Y=isNaN(Y)?999999:Y;}else{if(!isNaN(Z)&&!isNaN(Y)){Z=Z;Y=Y;}else{Z=isNaN(Z)?0:Z;Y=isNaN(Y)?0:Y;}}}else{if(!isNaN(new Date(Z))&&!isNaN(new Date(Y))){Y=new Date(Y).getTime();Z=new Date(Z).getTime();}}return Z>Y?1:(Z<Y?-1:0);}});}});if(Q!=undefined&&Q=="Occurrences"){o[o.length-1].maxWidth=130;
o[o.length-1].align="center";}if(Q!=undefined&&Q=="Dump Sources"){o[o.length-1].maxWidth=110;o[o.length-1].customWidth=110;o[o.length-1].align="center";}if(Q!=undefined&&Q=="Programs  causing the dump"){o[o.length-1].minWidth=210;o[o.length-1].customWidth=210;o[o.length-1].flex=1;o[o.length-1].align="center";
}if(Q!=undefined&&Q=="Terminals impacted"){o[o.length-1].maxWidth=150;o[o.length-1].customWidth=150;o[o.length-1].align="center";}if(Q!=undefined&&Q=="Users Impacted"){o[o.length-1].maxWidth=140;o[o.length-1].customWidth=150;o[o.length-1].align="center";}if(Q!=undefined&&Q=="Dump type"){o[o.length-1].minWidth=110;
o[o.length-1].flex=0.5;}}var q=true;var c="";c=[{ptype:"rowexpander",selectRowOnExpand:true,expandOnDblClick:false,expandOnEnter:false,collapsible:true,animCollapse:false,rowBodyTpl:['<div style="padding:10px 5px 10px 0px;" >{userDetailList}</div>']}];var P=8;if(x>1000){var e=x-1000;var K=Ext.util.Format.round((e/100),0);
P=P+K;}var m=1;var O=true;if(P<z.length){O=false;}if(gridPageSize<T.length){q=false;}if(customPaging){q=true;}if(fromPerBtn){activePage=Math.ceil(T.length/gridPageSize);}var V=[];V.push({xtype:"customgrid_builder",sortableColumns:true,needtoFixColumn:true,ui:"newGridPanel",id:"customgridId"+M,margin:"0 10 10 10",padding:0,border:true,scroll:false,autoScroll:true,layout:{type:"vbox",align:"stretch"},flex:1,forceFit:true,store:b,columns:o,plugins:c,viewConfig:{stripeRows:true,getRowClass:function(s,Y,X,W){if(s.raw.dataDetail==""){return"hidePlus";
}else{return;}},listeners:{sortchange:function(X,Y,Z,W,s){me.gridColIndexParam=Y.getIndex();me.gridColStateParam=Y.sortState;this.getStore().loadPage(m);}}},sortableColumns:true,listeners:{render:function(s){Ext.defer(function(){for(var W in o){}},100);},},dockedItems:[{xtype:"pagingtoolbar",cls:"pagingtoolbar",dock:"bottom",displayInfo:true,cls:"pagingtoolbar",store:b,id:"pageingTool"+M,hidden:q,displayInfo:true,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No Data to display",listeners:{change:function(s,W){}}}],});
V.push({xtype:"container",id:"customPageinationId"+M,margin:"0 0 0 0",});return{xtype:"container",id:"containerr"+M,layout:{type:"vbox",align:"stretch"},flex:1,items:V};},getGridWithSubCol:function(I,u,y,x,l,M,e){var s=0;var j=0;var O=0;var i=u.sortIndex;var E="DESC";if(u.sortOrderStatus!=undefined){E=u.sortOrderStatus;
}var A=u.gridColums;var v=u.gridColLanguageObj;var P=u.gridData;var R=u.customWidth;var h="left";if(u.subColAlign!=undefined){h=u.subColAlign;}var t=new Array();var L=new Array();var F=0;var m=this;var b=10;if(l>120){b=l-90-75;b=b/24;b=Ext.util.Format.round(b,0);}for(var n in A){var B=n;var G=n;if(v!=undefined&&v[G]!=undefined){G=v[G];
}var w=A[n];var N;if(R!=undefined&&R[F]!=undefined&&R[F]!=""){N=parseFloat(R[F]);}else{N="";}if(w.length>0){var q=new Array();for(var z in w){if(i==F){s=O;j=z;}var C=w[z];var d=C;if(v!=undefined&&v[d]!=undefined){d=v[d];}if(w.length<3){h="center";}if(R!=undefined&&R[F]!=undefined&&R[F]!=""){N=parseFloat(R[F]);
}else{N="";}var k=C+(F++);t.push({name:k});q.push({header:d,align:h,dataIndex:k,sortable:true,customWidth:N,flex:1,renderer:function(aa,T,W,ae,U,ab,c){if(aa!=undefined&&aa.indexOf("eGTilteG")>-1){aa=aa.replace("eGTilteG","~");}if(aa.indexOf("~DDLink")>-1){var ac=aa.substring(0,aa.indexOf("~DDLink"));
var f=aa.substring(aa.indexOf("~DDLink")+7);if(!isNaN(ac)&&!isNaN(parseFloat(ac))){aa='<span class="decimal-align"><a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+f+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+ac+"</a></span>";
}else{aa='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+f+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+ac+"</a>";}return aa;}if(aa.indexOf("~DD")>-1){var ac=aa.substring(0,aa.indexOf("~DD"));var f=aa.substring(aa.indexOf("~DD")+3);
aa='<span class="decimal-align"><a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:parent.printWindowFnWithHeaderBuilder(\''+f+"','Detail');\" >"+ac+"</a></span>";return aa;}var X="";var Z="no";var V="";if(M){if(aa.indexOf("@@")!=-1){X=aa.substring(aa.indexOf("@@")+2);aa=aa.substring(0,aa.indexOf("@@"));
Z="yes";}if(aa.indexOf("$$")!=-1){V=aa.substring(aa.indexOf("$$")+2);aa=aa.substring(0,aa.indexOf("$$"));}}if(aa.indexOf("%")>-1){T.tdAttr="";}else{T.tdAttr='data-qclass=yellowTip data-qtip="'+aa.trim()+'"';}var ad="";var Y="";if(!isNaN(aa)&&!isNaN(parseFloat(aa))||aa=="-"){if(aa!=null&&aa.indexOf(".")>-1){ad=aa.substring(aa.indexOf("."));
Y=aa.substring(0,aa.indexOf("."));if(Z=="yes"&&M){aa='<table><tr><td class="'+X+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+Y+'</span><span class="decimal-align2">'+ad+"</span></td></tr></table>";}else{if(M){aa='<span class="decimal-align" style="background:'+V+'">'+Y+'</span><span class="decimal-align2" style="background:'+V+'">'+ad+"</span>";
}else{aa='<span class="decimal-align">'+Y+'</span><span class="decimal-align2">'+ad+"</span>";}}}else{if(Z=="yes"&&M){aa='<table><tr><td class="'+X+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+aa+"</span></td></tr></table>";}else{if(M){aa='<span class="decimal-align" style="background:'+V+'">'+aa+"</span>";
}else{aa='<span class="decimal-align">'+aa+"</span>";}}}}return aa;},doSort:function(f){var c=this.up("grid").store;var T=this.getSortParam();c.sort({property:T,direction:f,sorterFn:function(V,U){V=V.get(T);U=U.get(T);if(V.indexOf("~DD")!=-1){V=V.substring(0,V.indexOf("~DD"));}if(U.indexOf("~DD")!=-1){U=U.substring(0,U.indexOf("~DD"));
}if(!isNaN(V)&&!isNaN(U)){V=Ext.isNumber(V)?V:parseFloat(String(V),10);U=Ext.isNumber(U)?U:parseFloat(String(U),10);if(f=="ASC"){V=isNaN(V)?999999:V;U=isNaN(U)?999999:U;}else{V=isNaN(V)?0:V;U=isNaN(U)?0:U;}}else{if(!isNaN(new Date(V))&&!isNaN(new Date(U))){U=new Date(U).getTime();V=new Date(V).getTime();
}}return V>U?1:(V<U?-1:0);}});},listeners:{headerclick:function(X,U,Y,ac,Z){var T=Ext.getCmp("er_sortingColumn");if(T!=undefined){var V=U.text;if(V!=undefined&&V=="Error"){V+=" (%)";}var W=true;if(wildcardSearch){var f=Ext.getCmp("wildcardSearch").getValue();if(f!=undefined&&f.trim().length>0&&f!="*"){W=false;
}}if(!Ext.isEmpty(T.getStore())&&!Ext.isEmpty(T)&&W){var ab=T.getStore().findExact("displayField",V,0);if(ab!=undefined&&ab!=-1){var c=T.getStore().getAt(ab);var aa=c.get("valueField");if(T.getValue()!=undefined&&T.getValue()!=aa){T.setValue(aa);if(!keepResult){appConstants.totalRec=0;appConstants.currentPage=1;
}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(this.up("panel"));}}}}}}});}L.push({header:G,dataIndex:n,flex:1,sortable:true,columns:q,});}else{var Q=0;if(i==F){s=O;j=null;}var k=n+(F++);t.push({name:k});var D="left";if(B!=undefined&&B.indexOf("$")!=-1){var o=B.substring(B.indexOf("$")+1);
if(o!=undefined&&o.trim()=="center"){D="center";}}L.push({header:G,sortable:true,align:D,dataIndex:k,flex:1,customWidth:N,renderer:function(ab,T,X,af,V,ac,c){if(ab!=undefined&&ab.indexOf("eGTilteG")>-1){ab=ab.replace("eGTilteG","~");}if(ab.indexOf("~DDLink")>-1){var ad=ab.substring(0,ab.indexOf("~DDLink"));
var f=ab.substring(ab.indexOf("~DDLink")+7);if(!isNaN(ad)&&!isNaN(parseFloat(ad))&&V!=0){ab='<span class="decimal-align"><a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+f+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+ad+"</a></span>";
}else{ab='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+f+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+ad+"</a>";}return ab;}if(ab.indexOf("~DD")>-1){var ad=ab.substring(0,ab.indexOf("~DD"));var f=ab.substring(ab.indexOf("~DD")+3);
if(!isNaN(ad)&&!isNaN(parseFloat(ad))){ab='<span class="decimal-align"><a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:parent.printWindowFnWithHeaderBuilder(\''+f+"','Detail');\" >"+ad+"</a></span>";}else{ab='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:parent.printWindowFnWithHeaderBuilder(\''+f+"','Detail');\" >"+ad+"</a>";
}return ab;}var U="";if(c.ownerCt.columns[V]!=undefined&&c.ownerCt.columns[V].dataIndex.indexOf("Components")==0&&e){T.style="cursor: pointer;";U="forCursorSymbol";}if(ab.indexOf("%")>-1){T.tdAttr="";}else{if(ab.indexOf(" week")>-1){ab=m.getDataForWeekGroup(ab);T.tdAttr='data-qclass=yellowTip data-qtip="'+ab.trim()+'"';
}else{T.tdAttr='data-qclass=yellowTip data-qtip="'+ab.trim()+'"';}}var Y="";var aa="no";var W="";if(M){if(ab.indexOf("@@")!=-1){Y=ab.substring(ab.indexOf("@@")+2);ab=ab.substring(0,ab.indexOf("@@"));aa="yes";}if(ab.indexOf("$$")!=-1){W=ab.substring(ab.indexOf("$$")+2);ab=ab.substring(0,ab.indexOf("$$"));
}}var ae="";var Z="";if(!isNaN(ab)&&!isNaN(parseFloat(ab))||ab=="-"){if(ab!=null&&ab.indexOf(".")>-1){ae=ab.substring(ab.indexOf("."));Z=ab.substring(0,ab.indexOf("."));if(aa=="yes"&&M){ab='<table><tr><td class="'+Y+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+Z+'</span><span class="decimal-align2">'+ae+"</span></td></tr></table>";
}else{if(M){ab='<span class="decimal-align" style="background:'+W+'">'+Z+'</span><span class="decimal-align2" style="background:'+W+'">'+ae+"</span>";}else{ab='<span class="decimal-align">'+Z+'</span><span class="decimal-align2">'+ae+"</span>";}}}else{if(aa=="yes"&&M){ab='<table><tr><td class="'+Y+'">&nbsp;&nbsp;&nbsp;</td><td><span class="decimal-align">'+ab+"</span></td></tr></table>";
}else{if(M){ab='<span class="decimal-align" style="background:'+W+'">'+ab+"</span>";}else{ab='<span class="decimal-align">'+ab+"</span>";}}}}if(e){ab='<div class="'+U+'">'+ab+"</div>";}return ab;},doSort:function(f){var c=this.up("grid").store;var T=this.getSortParam();c.sort({property:T,direction:f,sorterFn:function(V,U){V=V.get(T);
U=U.get(T);if(V.indexOf("~DD")!=-1){V=V.substring(0,V.indexOf("~DD"));}if(U.indexOf("~DD")!=-1){U=U.substring(0,U.indexOf("~DD"));}if(!isNaN(V)&&!isNaN(U)){V=Ext.isNumber(V)?V:parseFloat(String(V),10);U=Ext.isNumber(U)?U:parseFloat(String(U),10);if(f=="ASC"){V=isNaN(V)?999999:V;U=isNaN(U)?999999:U;}else{if(!isNaN(V)&&!isNaN(U)){V=V;
U=U;}else{V=isNaN(V)?0:V;U=isNaN(U)?0:U;}}}else{if(!isNaN(new Date(V))&&!isNaN(new Date(U))){U=new Date(U).getTime();V=new Date(V).getTime();}}return V>U?1:(V<U?-1:0);}});},listeners:{headerclick:function(X,U,Y,ac,Z){var T=Ext.getCmp("er_sortingColumn");if(T!=undefined){var V=U.text;var W=true;if(wildcardSearch){var f=Ext.getCmp("wildcardSearch").getValue();
if(f!=undefined&&f.trim().length>0&&f!="*"){W=false;}}if(!Ext.isEmpty(T.getStore())&&!Ext.isEmpty(T)&&W){var ab=T.getStore().findExact("displayField",V,0);if(ab!=undefined&&ab!=-1){var c=T.getStore().getAt(ab);var aa=c.get("valueField");if(T.getValue()!=undefined&&T.getValue()!=aa){T.setValue(aa);if(!keepResult){appConstants.totalRec=0;
appConstants.currentPage=1;}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(this.up("panel"));Q++;}}}}}}});}O++;}var p="";if(appConstants.isSoringColEnable&&appConstants.gridMultiSortEnable!=undefined&&appConstants.gridMultiSortEnable=="yes"){p=Ext.create("Ext.toolbar.Toolbar",{items:[{xtype:"tbtext",text:"Multi Soring :  ",reorderable:false},{xtype:"button",id:"multisortNew",cls:"iconMoreOptions",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"Multi Sort"});
},click:function(){var W=Ext.getCmp("er_sortingColumn");var Y=Ext.getCmp("er_secondaryColSort");var T=[];if(appConstants.builderJson.combo!=undefined){var X=appConstants.builderJson.combo.sortingColumnCombo;if(X!=undefined){for(var V=0;V<X.length;V++){var f=X[V];var aa=f.displayField;var Z=f.valueField;
var U=false;if(Z==W.getValue()||Z==Y.getValue()){U=true;}T.push({xtype:"checkbox",cls:"checkbt",boxLabel:aa,name:aa,inputValue:Z,checked:U,});}}}Ext.create("Ext.window.Window",{title:"Multi Sorting Column",width:400,border:false,frame:false,modal:true,ghost:false,height:280,listeners:{show:function(ab){if(this.modal){var ac=Ext.dom.Query.select(".x-mask");
for(var ad=0;ad<ac.length;ad++){var c=Ext.fly(ac[ad]);c.addCls("windowModal");}}},hide:function(ab){var ac=Ext.dom.Query.select(".x-mask");if(this.modal){var c=Ext.fly(ac[0]);c.removeCls("windowModal");}},afterrender:function(){Ext.EventManager.onWindowResize(function(){var c=this;c.center();},this);
}},items:[{xtype:"panel",autoScroll:true,scroll:true,height:270,autoHeight:true,style:{"overflow-x":"hidden"},id:"chekboxAllCol",items:[{xtype:"checkboxgroup",columns:2,vertical:true,width:"100%",margin:"10px",id:"multiColchkboxgroup",items:T,listeners:{change:function(ac,ad){if(Object.keys(ad).length>2){var ab=1;
for(var ae in ad){if(ad.hasOwnProperty(ae)){var c=Ext.ComponentQuery.query("[name="+ae+"]");if(ab==1){var ag=c[0].id;var af=Ext.getCmp(ag);af.setValue(false);}ab++;}}}}}}]}],buttonAlign:"center",buttons:[{text:"Update",id:"multisortSelectId",cls:"quickMenuWhiteButton",handler:function(ab){var ac=Ext.getCmp("multiColchkboxgroup").getChecked();
var c=Ext.getCmp("multisort");if(ac.length>1){appConstants.gridMultiSortEnable="yes";c.setValue(true);}else{appConstants.gridMultiSortEnable="no";c.setValue(false);}Ext.each(ac,function(ae,ad){if(ad==0){W.setValue(ae.getSubmitValue());}else{if(ad==1){Y.setValue(ae.getSubmitValue());}}});if(!keepResult){appConstants.totalRec=0;
appConstants.currentPage=1;}Ext.getCmp("main").show();appConstants.appObj.getController(appConstants.appController).gridCustomPaging(p.up("panel"));this.up("window").destroy();}}],}).show();}},}]});}gridPageSize=b;var a=Ext.create("Ext.data.ArrayStore",{fields:t,proxy:{type:"pagingmemory",reader:{type:"array"}},pageSize:gridPageSize,sortable:true,remoteSort:true,autoLoad:true,data:P,});
var r=true;var K=8;if(x>1000){var g=x-1000;var H=Ext.util.Format.round((g/100),0);K=K+H;}var J=true;if(K<t.length){J=false;}if(gridPageSize<P.length){r=false;}if(customPaging){r=true;}if(fromPerBtn){activePage=Math.ceil(P.length/gridPageSize);}var S=[];S.push({xtype:"customgrid_builder",tbar:p,store:a,columns:L,id:"customgridId"+I,frame:false,padding:0,margin:"0 10 10 10",autoScroll:true,needtoFixColumn:true,popUpData:"noToolTip",scroll:true,ui:"newGridPanel",layout:{type:"vbox",align:"stretch"},flex:1,border:true,sortableColumns:true,listeners:{sortchange:function(T,U,V,f,c){this.getStore().load();
},render:function(c){Ext.defer(function(){if(j==null){c.columns[s].setSortState(E,true,false);}else{c.columns[s].items.items[j].setSortState(E,true,false);}},100);}},dockedItems:[{xtype:"pagingtoolbar",cls:"newPagination",dock:"bottom",displayInfo:true,store:a,id:"pageingTool"+I,hidden:r,displayInfo:true,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No Data to display",listeners:{change:function(c,f){}}}],});
S.push({xtype:"container",id:"customPageinationId"+I,margin:"0 0 0 0",});return{xtype:"container",id:"containerr"+I,layout:{type:"vbox",align:"stretch"},flex:1,items:S};},getGrid:function(F,r,H,A,I,u,x,m){var t=new Array();var w=new Array();var v="DESC";if(r.sortOrderStatus!=undefined){v=r.sortOrderStatus;
}var f=0;if(r.sortIndex!=undefined){f=r.sortIndex;}var e=r.gridColums;var h=r.gridColLanguageObj;var G=r.gridData;var p=r.customWidth;var z=r.gridHeaderWrap;var y="newGridPanel";if(z!=undefined&&z=="yes"){y="newGridPanel headerTextWrap";}gridPageSize=10;if(I>120){temp1=I-60-75;temp1=temp1/24;temp1=Ext.util.Format.round(temp1,0);
gridPageSize=temp1;}var q;for(var B in e){var l;q="left";if(p!=undefined&&p[B]!=undefined&&p[B]!=""){l=parseFloat(p[B]);}else{l="";}var g=e[B];if(Ext.isEmpty(g)){g="qwe";}var C=g;if(h!=undefined&&h[C]!=undefined){C=h[C];}var d={};if(g!=undefined&&g.indexOf("$")>-1){var a=g.substring(g.indexOf("$")+1);
if(a.indexOf("(")>-1){a=a.substring(0,a.indexOf("("));}var E="20px";if(a.indexOf("$")>-1){E=a.substring(a.indexOf("$")+1);a=a.substring(0,a.indexOf("$"));}if(a!=undefined&&a!=null&&a.trim()=="center"){d["padding-left"]=E;q="center";}g=g.substring(0,g.indexOf("$"));}t.push(g);if(C!=undefined&&C.indexOf("(")!=-1){q="center";
}if(C!=undefined&&C.indexOf("~")!=-1){C=C.substring(0,C.indexOf("~"));}w.push({header:C,align:q,dataIndex:g,sortable:true,customWidth:l,flex:1,renderer:function(U,R,k,P,T,L,Q){if(U!=undefined&&U.indexOf("eGTilteG")>-1){U=U.replace("eGTilteG","~");}if(U!=undefined&&U.indexOf("~DDLink")>-1){var S=U.substring(0,U.indexOf("~DDLink"));
var K=U.substring(U.indexOf("~DDLink")+7);U='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+K+"','DDWindow','width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,resizable');\" >"+S+"</a>";return U;}if(U!=undefined&&U.indexOf("~DD")>-1){var S=U.substring(0,U.indexOf("~DD"));
var K=U.substring(U.indexOf("~DD")+3);U='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:parent.printWindowFnWithHeaderBuilder(\''+K+"','Detail');\" >"+S+"</a>";return U;}var W="";var Y="no";var Z="";if(u){if(U.indexOf("@@")!=-1){W=U.substring(U.indexOf("@@")+2);U=U.substring(0,U.indexOf("@@"));
Y="yes";}if(U.indexOf("$$")!=-1){Z=U.substring(U.indexOf("$$")+2);U=U.substring(0,U.indexOf("$$"));}}var J="";var N="";if(x){N="anchorLinkDefault";}if(U!=undefined&&U.indexOf("$")!=-1){J=U.substring(U.lastIndexOf("$")+1);U=U.substring(0,U.indexOf("$"));}var O=U;var X="";if(x){R.style="cursor: pointer;";
X="forCursorSymbol";}if(O.indexOf("%")>-1&&O.indexOf("~")>-1){var M=O.split("~");var V='<table width="100%" cellpadding="0" cellspacing="0" border="0"  height="8" class="prog_border">';V+="<tr>";V+='<td align="left" width="100%" height="8" >';V+='<table width="'+M[2]+'" height="8"  cellpadding="0" cellspacing="0" border="0">';
V+="<tr>";V+='<td class="reporterProgressBar" width="100%" style="background:'+M[1]+'"> </td>';V+="</tr>";V+="</table>";V+="</td>";V+="</tr>";V+="</table>";O="<table width='100%' cellpadding='0' cellspacing='0' ><tr><td style='width:100px;padding:6px' class='font_normal11'><span class='"+N+"'>"+M[0]+"</span></td><td style='padding:3px'>"+V+"</td></tr></table>";
R.tdAttr=M[0];R.style="padding:2px 10px 2px 10px";}else{R.tdAttr='data-qclass=yellowTip data-qtip="'+U.trim()+'"';}if(x){O='<div class="'+X+'"><span class="'+N+'">'+O+'</span><span id="myspan" style="width: 0px; display: none;">$'+J+"</span></div>";}if(U!=null&&(U=="iconUserHighIdleTime16"||U=="noSymbol")){if(U=="iconUserHighIdleTime16"){O='<div class="iconUserHighIdleTime16">&nbsp;&nbsp;&nbsp;</div>';
}else{O='<div class="">&nbsp;&nbsp;&nbsp;</div>';}R.tdCls="iconColumn";}return O;},doSort:function(J){var k=this.up("grid").store;var K=this.getSortParam();k.sort({property:K,direction:J,sorterFn:function(M,L){M=M.get(K);L=L.get(K);M=M.indexOf("$dateLongSort$")!=-1?M.substring(M.indexOf("$dateLongSort$")+"$dateLongSort$".length,M.lastIndexOf("$")):M.indexOf("~")!=-1?M.substring(0,M.indexOf("~")):M.indexOf("$")!=-1?M.substring(0,M.indexOf("$")):M;
L=L.indexOf("$dateLongSort$")!=-1?L.substring(L.indexOf("$dateLongSort$")+"$dateLongSort$".length,L.lastIndexOf("$")):L.indexOf("~")!=-1?L.substring(0,L.indexOf("~")):L.indexOf("$")!=-1?L.substring(0,L.indexOf("$")):L;if(!isNaN(M)&&!isNaN(L)){M=Ext.isNumber(M)?M:parseFloat(String(M),10);L=Ext.isNumber(L)?L:parseFloat(String(L),10);
if(J=="ASC"){M=isNaN(M)?999999:M;L=isNaN(L)?999999:L;}else{if(!isNaN(M)&&!isNaN(L)){M=M;L=L;}else{M=isNaN(M)?0:M;L=isNaN(L)?0:L;}}}else{if(!isNaN(new Date(M))&&!isNaN(new Date(L))){L=new Date(L).getTime();M=new Date(M).getTime();}}return M>L?1:(M<L?-1:0);}});},});}var j=Ext.create("Ext.data.ArrayStore",{fields:t,proxy:{type:"pagingmemory",reader:{type:"array"}},pageSize:gridPageSize,remoteSort:true,sortable:true,autoLoad:true,data:G,});
var o=true;var n=8;if(A>1000){var i=A-1000;var b=Ext.util.Format.round((i/100),0);n=n+b;}var s=true;var c="0 10 10 10";if(n<t.length){s=false;}if(gridPageSize<G.length){o=false;}if(customPaging){o=true;c="0 10 0 10";}if(fromPerBtn){activePage=Math.ceil(G.length/gridPageSize);}var D=[];D.push({xtype:"customgrid_builder",columns:w,store:j,frame:false,autoScroll:true,needtoFixColumn:true,autoScroll:true,popUpData:"noToolTip",padding:0,margin:c,ui:y,scroll:true,id:"customgridId"+F,border:true,layout:"fit",align:"stretch",sortableColumns:true,listeners:{render:function(k){Ext.defer(function(){for(var J in w){if(k.columns[f]!=undefined){k.columns[f].setSortState(v,true,false);
}}},100);},},dockedItems:[{xtype:"pagingtoolbar",cls:"newPagination",dock:"bottom",displayInfo:true,store:j,id:"pageingTool"+F,hidden:o,displayInfo:true,displayMsg:"Total Records : {2}",emptyMsg:"No Data to display",listeners:{change:function(k,J){},afterrender:function(){this.down("#refresh").hide();
}}}],});D.push({xtype:"container",id:"customPageinationId"+F,margin:"0 0 0 0",});return{xtype:"container",items:D};},getNoMeasure:function(){return{xtype:"container",cls:"containerShadow",margin:10,html:'<div class="egFlexCenterByColumnWise" style="height:100%"> <div class="iconInformation"></div> <div class="commonErrorMsgText">No Measures Available!</div> </div>'};
},getNoMeasureWithoutBorder:function(){return{xtype:"container",margin:10,html:'<div class="egFlexCenterByColumnWise" style="height:100%"> <div class="iconInformation"></div> <div class="commonErrorMsgText">No Measures Available!</div> </div>'};},getNoMeasureWithoutBorderNew:function(){return{xtype:"container",margin:10,html:'<div class="egFlexCenterByColumnWise" style="height:100%"> <div class="iconInformation"></div> <div class="commonErrorMsgText">No Measures Available!</div> </div>'};
},getMessageBox:function(b,a){Ext.MessageBox.show({title:b,msg:a,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;},loadComboField:function(c,g,h,j,f,b,k,l){var i=Ext.ComponentManager.get(c);if(f.combo!=undefined){if(f.combo.hasOwnProperty(g)){var a=f.combo[g];if(c=="er_component"){appConstants.compRawData=a;
}if(c=="er_info"){appConstants.infoRawData=a;}if(c=="er_mutiSelComp"){appConstants.compTypeRawData=a;}if(i!=undefined&&a!=undefined){i.getStore().loadRawData(a);}if(f.selectedFields!=undefined&&f.selectedFields.hasOwnProperty(j)&&f.selectedFields[j]!=null){i.setValue(f.selectedFields[j]);}else{i.setValue(a[0].valueField);
}if(l){if(f.displayFields.hasOwnProperty(h)){if(!b){i.setFieldLabel(f.displayFields[h]);}else{Ext.ComponentManager.get(k).setFieldLabel(f.displayFields[h]);}}}if(!b){if(i.isHidden()&&(c!="er_showBy"&&c!="er_test"&&c!="er_measure"&&c!="er_info")){i.show();}}else{var d=Ext.ComponentManager.get(k);if(d!=undefined&&d.isHidden()&&k!="er_showBy"&&k!="er_test"&&k!="er_measure"&&k!="er_info"&&k!="measmultipane"&&k!="infomultipane"){d.show();
}}}else{if(!b){if(!i.isHidden()){i.hide();}}else{var d=Ext.ComponentManager.get(k);if(d!=undefined&&!d.isHidden()){d.hide();}}}}if(appConstants.hasOwnProperty("isCustomLayout")){if(appConstants.isCustomLayout=="yes"){var e=Ext.getCmp("pbarcont");if(!Ext.isEmpty(e)){e.hide();}}}},getDataForWeekGroup:function(b){var a=b;
b=b.substring(0,b.indexOf("."));switch(b){case"01":a=a.substring(a.indexOf(".")+1,a.length);a="Jan-"+a;break;case"02":a=a.substring(a.indexOf(".")+1,a.length);a="Feb-"+a;break;case"03":a=a.substring(a.indexOf(".")+1,a.length);a="Mar-"+a;break;case"04":a=a.substring(a.indexOf(".")+1,a.length);a="Apr-"+a;
break;case"05":a=a.substring(a.indexOf(".")+1,a.length);a="May-"+a;break;case"06":a=a.substring(a.indexOf(".")+1,a.length);a="Jun-"+a;break;case"07":a=a.substring(a.indexOf(".")+1,a.length);a="Jul-"+a;break;case"08":a=a.substring(a.indexOf(".")+1,a.length);a="Aug-"+a;break;case"09":a=a.substring(a.indexOf(".")+1,a.length);
a="Sep-"+a;break;case"10":a=a.substring(a.indexOf(".")+1,a.length);a="Oct-"+a;break;case"11":a=a.substring(a.indexOf(".")+1,a.length);a="Nov-"+a;break;case"12":a=a.substring(a.indexOf(".")+1,a.length);a="Dec-"+a;break;}return a;},hideComboField:function(){Ext.getCmp("iconReportSelectionHide").hide();
Ext.getCmp("templateform").hide();Ext.getCmp("er_mutiSelComp").hide();Ext.getCmp("er_compType").hide();Ext.getCmp("compmultipane").hide();Ext.getCmp("compTypeMultiPane").hide();},loadTableWithMergingColumns:function(r,g,u,n,v,j,m,e){var t=g.gridData;if(t!=undefined&&t.length>0){var b="";var s=this;var l=new Array();
var h=new Array();var a=g.gridColums;var f=g.customWidth;for(var o in a){var c=a[o];if(f!=undefined&&f[o]!=undefined&&f[o]!=""){customWidth=parseFloat(f[o]);}else{customWidth="";}var p=c;var i="left";h.push(c);l.push({header:p,align:i,dataIndex:c,sortable:false,customWidth:customWidth});}var d=Ext.create("Ext.data.ArrayStore",{fields:h,autoLoad:true,data:t});
var q=[];q.push({xtype:"customgrid_builder",columns:l,store:d,height:v-70,forceFit:true,padding:0,margin:10,ui:"newGridPanel firstColumnPlainColor",id:"customgridId"+r,border:true,listeners:{render:function(k){this.getView().on("refresh",this.updateRowSpan,this);}},updateRowSpan:function(){var w=this.columns,B=this.getView(),E=this.getStore(),A=E.getCount(),k=w[0],C=k.dataIndex,y=null,x=null;
spanValue=null;for(var G=0;G<A;++G){var F=B.getCellByPosition({row:G,column:0}).dom,z=E.getAt(G),D=z.get(C);if(spanValue!=D){if(y!==null){y.rowSpan=x;}Ext.fly(F).setStyle("display","");y=F;x=1;spanValue=D;}else{x++;Ext.fly(F).setStyle("display","none");}}if(y!==null){y.rowSpan=x;}}});return{xtype:"container",items:q};
}}});