var getDiv=0;var scrollFlag=false;var noListData=false;Ext.define("zones.view.ListPanel",{extend:"utilities.OuterPanel",requires:["zones.view.ListComponent","zones.view.OptionalListPanel"],alias:"widget.listpanel",cls:"outerpanel",frame:true,layout:{type:"vbox",align:"stretch",},header:{padding:"0 5 0 5",margin:0},showDashboard:false,margin:"8 8 0 0",autoDestroy:true,url:null,mask:null,tools:[{xtype:"button",cls:"iconAutomaticScrollRun",id:"iconAutomaticScrollRun",margin:"0px 4px 0px 4px",ui:"action",hidden:true,border:true,style:{border:"0px"},handler:function(){scrollFlag=true;
pageScroll();Ext.getCmp("iconAutomaticScrollRun").hide();},listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,autoDestroy:true,html:"Auto Scroll"});}}},{xtype:"button",cls:"iconAutomaticScrollStop",id:"iconAutomaticScrollStop",margin:"0px 4px 0px 4px",ui:"action",hidden:true,style:{border:"1px"},handler:function(){scrollFlag=false;
stopScroll();Ext.getCmp("iconAutomaticScrollStop").hide();},listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,autoDestroy:true,html:"Pause"});}}},{xtype:"tbseparator",cls:"removeLineForTvMode",hidden:true,},{xtype:"button",cls:"iconAutomaticScrollJumpToTop",id:"iconAutomaticScrollJumpToTop",margin:"0px 4px 0px 4px",ui:"action",hidden:true,style:{border:"0px"},handler:function(){scrollFlag=false;
jumpScroll();Ext.getCmp("iconAutomaticScrollStop").hide();},listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,autoDestroy:true,html:"Jump to top"});}}},{xtype:"tbseparator",cls:"removeLineForTvMode",hidden:true,},{xtype:"trigger",itemId:"zoneSearch",id:"zonelistpanelsearch",name:"zonelistpanelsearch",autoDestroy:true,cls:"whitedropdown_search",hidden:true,margin:"0 5 0 5",onTriggerClick:function(a){this.fireEvent("click",this);
}},{xtype:"tbseparator",itemId:"associationSeparator",hidden:true,autoDestroy:true,id:"assSeparatorId",name:"assSeparatorId"},{xtype:"button",cls:"iconAssociation",autoDestroy:true,hidden:true,margin:"0px 5px 0px 5px",id:"zoneAssociationId",name:"zoneAssociationId",action:"association",style:{border:"0px"},listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:Associations});
}}},{xtype:"tbseparator",autoDestroy:true,hidden:true,id:"backBtnSeparator",name:"backBtnSeparator"},{xtype:"button",hidden:true,id:"zonelistpanelbackbtn",autoDestroy:true,name:"zonelistpanelbackbtn",action:"back",cls:"backbutton",margin:"0 5 0 5",iconCls:"iconBack"}],listeners:{afterrender:function(){Ext.get("listpanel-body").on("scroll",function(){var e=Ext.getCmp("listpanel").body.dom;
var b="zones.view.ListComponent";if(isScroll==true&&e.scrollTop==(e.scrollHeight-e.offsetHeight)){var c=(startcount==null||startcount=="")?splitLen:startcount;var a=c+splitLen;a=(a>compLength)?compLength:a;zones.app.getController("Main").bulkDataLoad(c,a,b);}});}},items:[],initComponent:function(){var a=this;
holdRefresh=true;Ext.Ajax.request({url:a.url,method:"POST",success:function(g,d){if(showDashboard){a.removeAll();var o=a.getDockedItems();if(!Ext.isEmpty(o)){for(i=0;i<o.length;i++){o[i].hide();}}holdRefresh=false;o=null;delete o;var m="&treeOpen="+requestParams.treeOpen;if(!Ext.isEmpty(requestParams.openNode)){m+="&openNode="+requestParams.openNode;
}a.hide();a.up("main").add({xtype:"zonesdashboard",currentTab:requestParams.currentTab,aggregateTab:requestParams.aggregateTab,currentZone:requestParams.selectedParam,zoneState:requestParams.zoneState,treeUrl:m,region:"center"});m=null;delete m;}else{var e=g.responseText;var k=Ext.decode(e);a.down("trigger[itemId=zoneSearch]").emptyText=k.screenLabels["searchDefaultText"]?k.screenLabels["searchDefaultText"]:"";
a.down("trigger[itemId=zoneSearch]").setValue(k.screenLabels["searchText"]?k.screenLabels["searchText"]:"");noListData=false;if(k["SearchNoListFound"]||!k["showAssociations"]){noListData=true;a.down("button[action=association]").hide();a.down("tbseparator[itemId=associationSeparator]").hide();}else{a.down("button[action=association]").show();
a.down("tbseparator[itemId=associationSeparator]").show();}a.down("button[id=zonelistpanelbackbtn]").setText(requestParams.backButtonText);if(window.parent.globalsearch!=true){Ext.defer(function(){zoneGroupZoneListBtn=Ext.create("Ext.container.Container",{layout:{type:"hbox"},width:100,padding:"2 0 0 0",margin:"0 0 0 10",renderTo:"zoneView",items:[{xtype:"button",cls:"iconGroupView removeButtonCurve",id:"iconGroupViewclick",margin:0,padding:0,listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:Grid_View});
}},handler:a.onGroupViewChange},{xtype:"button",cls:"iconListViewDisable removeButtonCurve",margin:0,padding:0}]});},500);if(k.screenLabels["ListTitle"]){var h='<div style="float:left;">'+k.screenLabels["ListTitle"]+'</div><div style="float:left" id="zoneView"></div>';a.setTitle(h);}else{a.setTitle("&nbsp;");
}delete zoneGroupZoneListBtn;}var l={xtype:"toolbar",cls:"component-list-right-panel-header component-list-right-panel-header-right",hidden:k["NoListFound"],layout:"hbox",margin:0,padding:0,flex:1,items:[{xtype:"label",text:k.screenLabels["ListName"]?k.screenLabels["ListName"]:"",hidden:k["SearchNoListFound"],width:198,padding:"2px 5px 2px 10px"},{xtype:"label",width:2,height:22,padding:0,cls:"service_header",style:"left:200px !important;",hidden:k["SearchNoListFound"]},{xtype:"label",text:k.screenLabels["AssociatedElements"]?k.screenLabels["AssociatedElements"]:"",hidden:k["SearchNoListFound"],padding:"2px 5px 2px 6px",flex:1}]};
if(k["SearchNoListFound"]){var f=Ext.create("utilities.ErrorPanel",{border:false,flex:1,layout:"fit",errorMsg:'<div style="text-align:center;margin:17% auto 17% auto"><img src="/final/images/clear.png" class="iconInformation" /><br/><div class="list-empty-text">'+k["SearchNoListFoundText"]+"</div></div>",listeners:{boxready:function(){Ext.getCmp("iconAutomaticScrollRun").hide();
Ext.Element.select(".removeLineForTvMode").hide();Ext.getCmp("iconAutomaticScrollJumpToTop").hide();}}});a.add(f);}else{if(k["NoListFound"]){var c=Ext.create("utilities.ErrorPanel",{border:false,flex:1,layout:"fit",errorMsg:'<div style="text-align:center;margin:17% auto 17% auto"><img src="/final/images/clear.png" class="iconInformation" /><br/><div class="list-empty-text">'+k["NoListFoundText"]+"</div></div>",listeners:{boxready:function(){Ext.getCmp("iconAutomaticScrollRun").hide();
Ext.Element.select(".removeLineForTvMode").hide();Ext.getCmp("iconAutomaticScrollJumpToTop").hide();}}});a.add(c);}else{a.addDocked(l);var j=Ext.create("Ext.panel.Panel",{layout:{type:"vbox",align:"stretch"},autoScroll:true,listeners:{boxready:function(){if($("#listpanel-body")[0].scrollHeight>$("#listpanel-body").innerHeight()){}else{Ext.getCmp("iconAutomaticScrollRun").hide();
Ext.Element.select(".removeLineForTvMode").hide();Ext.getCmp("iconAutomaticScrollJumpToTop").hide();}if(window.parent.isTvMode){if(fromKioskMode){var p=window.parent.Ext.getCmp("playBtn").ifScroll=true;scrollFlag=true;pageScroll();}}}},cls:"list-panel-contents",bodyCls:"list-panel-bg zone-borderzero",border:false,autoDestroy:true,id:"listPanelContents",items:[]});
rootComponentArray=k["RootItem"];compLength=rootComponentArray.length;if(compLength>splitLen){for(var n=0;n<splitLen;n++){var b=Ext.create("zones.view.ListComponent",{rootComponent:rootComponentArray[n]});j.add(b);}a.add(j);isScroll=true;}else{for(var n=0;n<rootComponentArray.length;n++){var b=Ext.create("zones.view.ListComponent",{rootComponent:rootComponentArray[n]});
j.add(b);}a.add(j);delete j;}}}if(!Ext.isEmpty(a.mask)){a.mask.hide();}if(window.parent.globalsearch==true){a.setTitle(k.screenLabels["searchResultText"]+'  "'+window.parent.zoneSearchval+'"');Ext.getCmp("zonelistpanelbackbtn").hide();Ext.getCmp("zonelistpanelsearch").hide();Ext.getCmp("zoneAssociationId").hide();
Ext.getCmp("backBtnSeparator").hide();Ext.getCmp("assSeparatorId").hide();}else{Ext.getCmp("zonelistpanelbackbtn").show();Ext.getCmp("zonelistpanelsearch").show();Ext.getCmp("zoneAssociationId").show();Ext.getCmp("backBtnSeparator").hide();Ext.getCmp("assSeparatorId").show();}if(hideBackButton){Ext.getCmp("zonelistpanelbackbtn").hide();
}e=null;delete e;k=null;delete k;}},failure:function(){alert("failure");holdRefresh=false;}});this.callParent();},onGroupViewChange:function(){var c=null;var b=document.getElementsByTagName("body")[0];if(!Ext.isEmpty(Ext.get(b))){c=new Ext.LoadMask(Ext.get(b),{msg:"Loading...",cls:"maskDash"});c.show();
}var e=Ext.getCmp("zoneMain");var d="/final/monitor/zones.jsp";var g={xtype:"optionallistpanel",id:"optionallistpanel",region:"center",flex:4,mask:c,url:"/final/monitor/zones.jsp"};var a=[{xtype:"zonestreepanel",id:"zonestreepanel",border:false,header:false,region:"west",cls:"removeTreeLeftBorder",collapsed:!requestParams.treeOpen,url:"/final/monitor/zoneTree.jsp?tree=ZoneTreeModel&width=208&str=sessionID&node=Zone&treeTitle=Zones Navigation",split:true,collapseMode:"mini",collapsible:true,width:250,maxWidth:350,minWidth:150},g];
var h=e.items.items;for(var f=h.length-1;f>-1;f--){h[f].destroy();}e.removeAll();Ext.suspendLayouts();e.add(a);Ext.resumeLayouts(true);}});