Wtf.tree.TableTreeUI=function(A){this.node=A;this.rendered=false;this.animating=false;this.wasLeaf=true;this.addEvents={"contextmenu":true,"checkchange":true};this.ecc="x-tree-ec-icon x-tree-elbow";this.actualColors=["#d96666","#e67399","#b373b3","#8c66d9","#668cb3","#668cd9","#59bfb3","#65ad89","#4cb052","#8cbf40","#bfbf4d","#e0c240","#f2a640","#e6804d","#be9494","#a992a9","#8997a5","#94a2be","#85aaa5","#a7a77d","#c4a883"]};Wtf.extend(Wtf.tree.TableTreeUI,Wtf.tree.TreeNodeUI,{SetBackColor:function(D){var C=this.actualColors[D];var B=this.iconNode.firstChild;B.style.backgroundPosition="-"+(D*15)+"px 0";var A=this.ecNode.childNodes;A[0].style.backgroundColor=C;A[0].style.borderColor=C;A[1].style.backgroundColor=C;A[2].style.backgroundColor=C;A[2].style.borderColor=C;return C},GetBackColor:function(B,C){var A=this.ecNode.childNodes;return(A[1].style.backgroundColor)},renderElements:function(D,I,H,K){this.indentMarkup=D.parentNode?D.parentNode.ui.getChildIndent():"";var E=typeof I.checked=="boolean";var A=I.href?I.href:Wtf.isGecko?"":"#";var J="-"+(I.colorIndex*15)+"px 0";var C=['<li class="x-tree-node"><table wtf:tree-node-id="',D.id,'" class="x-tree-node-el x-tree-node-leaf ',I.cls,'" cellspacing="0" cellpadding="0" class="s-tabletree-node-el "><tbody><tr><td>',this.indentMarkup,'</td><td class="s-tabletree-td">',E?('<input class="x-tree-node-cb" type="checkbox" '+(I.checked?'checked="checked" /></td><td class="chip">':'/></td><td class="chip">')):"</td>",'<div class="t2" style="border-color:',this.actualColors[I.colorIndex],"; background-color: ",this.actualColors[I.colorIndex],';"> </div>','<div style="padding-left: 3px; background-color:',this.actualColors[I.colorIndex],'; padding-bottom: 1px; white-space: normal;">','<a hidefocus="on"  class="x-tree-node-anchor" tabIndex="1" ',I.hrefTarget?' target="'+I.hrefTarget+'"':"",">",'<span class="calMenuLabel" unselectable="on" id="txtspan'+D.id+'">',D.text,"</span></div>",'<div style="border-color:',this.actualColors[I.colorIndex],"; background-color:",this.actualColors[I.colorIndex],';" class="b2"> </div></td><td class="calMenuImgCell">','<img src="',Wtf.BLANK_IMAGE_URL,'"  id="imgdiv'+D.id+'" nodeid="'+D.id+'" style="background-position:',J,'"/></td></tr></tbody></table><ul class="x-tree-node-ct" style="display:none;"></ul></li>'].join("");var G=1;this.wrap=Wtf.DomHelper.insertHtml("beforeEnd",D.parentNode.ui.ctNode,C);this.elNode=this.wrap.childNodes[0].childNodes[0].rows[0];this.ctNode=this.wrap.parentNode;var F=this.elNode.childNodes;this.indentNode=F[0].firstChild;this.ecNode=F[2];this.iconNode=F[3];if(E){this.checkbox=F[1].firstChild;G++}this.anchor=F[G].childNodes[1].firstChild;this.textNode=F[G].childNodes[1].firstChild.firstChild;Wtf.get("imgdiv"+D.id).on("click",this.onContextMenu,this);var B=Wtf.get("txtspan"+D.id);B.on("click",this.onClick,this);B.on("dblclick",this.onDblClick,this)},updateExpandIcon:function(){if(this.rendered){var F=this.node,D,C;var A="x-tree-elbow";var E=F.hasChildNodes();if(E||F.attributes.expandable){if(F.expanded){A+="-minus";D="x-tree-node-collapsed";C="x-tree-node-expanded"}else{A+="-plus";D="x-tree-node-expanded";C="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=D||this.c2!=C){Wtf.fly(this.elNode).replaceClass(D,C);this.c1=D;this.c2=C}}else{if(!this.wasLeaf){Wtf.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true}}var B="x-tree-ec-icon "+A;if(this.ecc!=B){this.ecNode.className=B;this.ecc=B}}},toggleCheck:function(B){var A=this.checkbox;if(A){A.checked=(B===undefined?!A.checked:B);this.node.attributes.checked=A.checked;this.fireEvent("checkchange",this.node,A.checked)}},onSelectedChange:function(A){if(A){this.focus();this.addClass("nodeSelected")}else{this.removeClass("nodeSelected")}},onContextMenu:function(A){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){A.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,A.getPageX(),A.getPageY())}}});Wtf.CalendarTree=function(A){Wtf.apply(this,A);this.nodeHash={};this.containerScroll=true;this.border=false;this.bodyStyle="padding:10px;";this.rootVisible=true;this.lines=false;this.treeRoot=new Wtf.tree.TreeNode({id:this.parentid+"rn",cls:"calroot",expanded:true,text:"Calendar(s)",cls:"takeleft",singleClickExpand:false});this.setRootNode(this.treeRoot);this.agendaStore=new Wtf.data.Store({url:this.url,baseParams:{action:0,userid:this.ownerid.userid,caltype:this.ownerid.type,latestts:"1970-01-01 00:00:00"},reader:new Wtf.data.JsonReader({root:"data"},["cid","cname","description","location","timezone","colorcode","caltype","isdefault","userid","timestamp","permissionlevel"])});this.agendaStore.on("load",this.loadTree,this);this.agendaStore.load();this.datePicker.on("select",this.DateSelected,this);this.addEvents({"treecheckchange":true,"changecolor":true,"deletecalendar":true,"calendarsettings":true});Wtf.CalendarTree.superclass.constructor.call(this)};Wtf.extend(Wtf.CalendarTree,Wtf.tree.TreePanel,{onRender:function(A){Wtf.CalendarTree.superclass.onRender.call(this,A);this.getSelectionModel().on("beforeselect",this.selectChanged,this)},loadTree:function(E,G,C){var D=false;for(var B=0;B<this.agendaStore.getTotalCount();B++){var A=name=Wtf.util.Format.ellipsis(this.agendaStore.getAt(B).data["cname"],15);var F=this.treeRoot.appendChild(new Wtf.tree.TreeNode({text:A,allowDrop:false,allowDrag:false,checked:(!D),icon:"lib/resources/images/default/s.gif",iconCls:"imgchange",cls:"treenodeclass",qtip:this.agendaStore.getAt(B).data["description"],qtipTitle:this.agendaStore.getAt(B).data["cname"],id:this.agendaStore.getAt(B).data["cid"],uiProvider:Wtf.tree.TableTreeUI,colorIndex:parseInt(this.agendaStore.getAt(B).data["colorcode"])}));if(F){F.attributes.request=false}D=true}if(D){this.defaultNode=this.getNodeById(this.agendaStore.getAt(0).data["cid"]);if(this.delayFlag){this.defaultNode.attributes.request=false;this.calcontrol=Wtf.getCmp(this.calControl);this.calcontrol.startCalEventBot(this.defaultNode.id);this.calcontrol.onDayViewClick();this.calcontrol.CalculatingTotalCalendar()}}this.attachListeners()},makeContextMenu:function(){var A=new Wtf.menu.ColorItem({id:this.parentid+"coloritem",colors:["CC3333","DD4477","994499","6633CC","336699","3366CC","22AA99","329262","109618","66AA00","AAAA11","D6AE00","EE8800","DD5511","A87070","8C6D8C","627487","7083A8","5C8D87","898951","B08B59"]});this.contextMenu=new Wtf.menu.Menu({id:this.parentid+"contextMenu",items:[{id:this.parentid+"Delete",iconCls:"pwnd delicon",text:"Delete",scope:this,handler:function(){if(this.treeRoot.firstChild==this.getSelectionModel().getSelectedNode()){Wtf.MessageBox.confirm("Confirm","Are you sure you want to delete all events?",function(B){if(B=="yes"){var C={};C.events=true;C.id=this.treeRoot.firstChild.id;this.fireEvent("deletecalendar",C.id)}},this)}else{Wtf.MessageBox.confirm("Confirm","Are you sure you want to delete?",function(B){if(B=="yes"){var C={};C.events=false;C.id=this.getSelectionModel().getSelectedNode().id;this.fireEvent("deletecalendar",C.id)}},this)}}},{id:this.parentid+"Edit",iconCls:"pwnd editiconwt",text:"Settings",scope:this,handler:function(){this.fireEvent("calendarsettings",this.getSelectionModel().getSelectedNode().id)}},{id:this.parentid+"thisonly",text:"Display only this calendar",iconCls:"pwnd checked",scope:this,handler:function(){var D=this.getSelectionModel().getSelectedNode();var B=this.treeRoot.childNodes;for(var C=0;C<B.length;C++){if(B[C].attributes.checked){B[C].ui.checkbox.checked=false;B[C].attributes.checked=false;var E=Wtf.getCmp(this.parentid+"calctrl");if(E){E.stopCalEventBot(B[C].id);E.HidingOtherCalendarEvent(B[C].id)}}}D.ui.checkbox.checked=true;D.attributes.checked=true;this.fireEvent("treecheckchange",this,D,true)}},"-",A]});A.on("select",function(D,B){var E=D.colors.indexOf(B);var C=this.getSelectionModel().getSelectedNode();this.fireEvent("changecolor",this,C,E)},this)},attachListeners:function(){this.on("checkchange",function(A,B){A.select();this.fireEvent("treecheckchange",this,A,B)},this);this.on("contextmenu",function(B,A,E){if(B!=this.treeRoot){this.getNodeById(B.id).select();if(!this.contextMenu){this.makeContextMenu()}this.contextMenu.showAt([A+11,E]);var C=this.agendaStore.find("cid",B.id);var D=1;if(C!=-1){D=this.agendaStore.getAt(C).data["permissionlevel"]}if(D!=""){Wtf.getCmp(this.parentid+"Delete").disable();Wtf.getCmp(this.parentid+"Edit").disable();Wtf.getCmp(this.parentid+"coloritem").disable()}else{Wtf.getCmp(this.parentid+"Delete").enable();Wtf.getCmp(this.parentid+"Edit").enable();Wtf.getCmp(this.parentid+"coloritem").enable()}}},this);this.on("click",function(A,B){var C=this.getNodeById(A.id).ui;C.getTextEl().style.background="transparent none repeat scroll 0%";C.getTextEl().style.color="#000000"},this)},selectChanged:function(){this.calcontrol=Wtf.getCmp(this.parentid+"calctrl");var A=Wtf.getCmp(this.parentTabId);if(!this.calcontrol){this.calcontrol=new Wtf.cal.control({id:this.parentid+"calctrl",title:"My Calendar",tabType:Wtf.etype.cal,iconCls:getTabIconCls(Wtf.etype.cal),closable:true,border:false,ownerid:{type:0,userid:loginid},myToolbar:true,calTabId:"tabmycal",layout:"fit",url:Wtf.req.cal+"caltree.jsp",calTree:this,calendar:this.datePicker,mainCal:true});A.add(this.calcontrol);A.doLayout();A.setActiveTab(this.calcontrol);this.calcontrol.on("destroy",function(C){var D=C.calTree.getChecked();for(var B=0;B<D.length;B++){D[B].attributes.request=false}C.calTree.getSelectionModel().clearSelections();C.calTree.calcontrol=null})}else{A.setActiveTab(this.calcontrol)}},DateSelected:function(){if(!this.calcontrol){this.selectChanged()}else{var A=Wtf.getCmp(this.parentTabId);A.setActiveTab(this.calcontrol)}}});Wtf.cal.createCal=function(A){this.parent=A;this.selNodeId=null;this.colorInd="";this.calRec=Wtf.data.Record.create([{name:"cid"},{name:"cname"},{name:"description"},{name:"location"},{name:"timezone"},{name:"colorcode"},{name:"caltype"},{name:"isdefault"},{name:"userid"},{name:"timestamp"}]);Wtf.cal.createCal.superclass.constructor.call(this)};Wtf.extend(Wtf.cal.createCal,Wtf.Component,{createcal:function(J){var G=Wtf.getCmp(this.parent.id+"gridpanel");var F=G.getStore();var D="";for(var H=0;H<F.getCount();H++){D+=F.getAt(H).get("userid");D+="_"+F.getAt(H).get("resourcename")+","}var K=this.parent.calTree.treeRoot.childNodes.length;var M=this.parent.calTree.tree;var A=Wtf.get(this.parent.id+"calname").getValue();A=Wtf.cal.utils.HTMLScriptStripper(A);var L=Wtf.get(this.parent.id+"des").getValue();L=Wtf.cal.utils.HTMLScriptStripper(L);var C=Wtf.get(this.parent.id+"timezone").getValue();var E=Wtf.get(this.parent.id+"country").getValue();if(this.colorInd==""){this.colorInd=0}if(A==""){Wtf.MessageBox.alert("Invalid Entry","Please enter the calendar name!")}else{if(!this.selNodeId){var I=[A,L,E,C,this.colorInd,this.parent.calTree.ownerid.type,"0",this.parent.calTree.ownerid.userid,D];this.parent.insertCalendar(I)}else{var B="0";var N=this.parent.calTree.agendaStore.find("cid",this.selNodeId);if(N!=-1){B=this.parent.calTree.agendaStore.getAt(N).data["isdefault"]}var I=[this.selNodeId,A,L,E,C,this.colorInd,this.parent.calTree.ownerid.type,B,this.parent.calTree.ownerid.userid,D];this.parent.updateCalendar(I)}this.parent.addCalendarTab1();this.selNodeId=null}},CreateCalendar:function(A){this.parent.add(new Wtf.Panel({frame:true,layout:"fit",deferredRender:true,id:this.parent.id+"createCalForm",border:false,items:[{bodyStyle:"position: relative;",autoScroll:true,id:this.parent.id+"innerpanel"}]}));this.Addfield();this.Addbuttons();this.clearCalFormFields();if(A){this.showSettingsForm(A)}},clearCalFormFields:function(){this.parent.formview="CreateCal";Wtf.getCmp(this.parent.id+"calname").setValue("");Wtf.getCmp(this.parent.id+"des").setValue("");Wtf.getCmp(this.parent.id+"selectColor").select("CC3333");Wtf.getCmp(this.parent.id+"person").setValue("< Select the user name >");var A=Wtf.getCmp(this.parent.id+"gridpanel");A.getStore().removeAll();Wtf.getCmp(this.parent.id+"create").setText("Create Calendar")},showSettingsForm:function(D){this.parent.formview="CreateCal";if(D){this.selNodeId=D;if(this.parent.calTree.agendaStore){var C=new this.calRec();var A=this.parent.calTree.agendaStore.find("cid",this.selNodeId);if(A!=-1){C=this.parent.calTree.agendaStore.getAt(A);var B=[C.data["cid"],C.data["cname"],C.data["description"],C.data["location"],C.data["timezone"],C.data["colorcode"],C.data["caltype"],C.data["isdefault"],C.data["userid"],C.data["timestamp"]];this.displaySettingValues(B)}}}},Addbuttons:function(){Wtf.getCmp(this.parent.id+"inner1").add(new Wtf.Panel({id:this.parent.id+"addbuttons",items:[new Wtf.Button({cls:"button1",text:"Cancel",id:this.parent.id+"cancel",scope:this.parent,handler:function(){this.addCalendarTab1();this.selNodeId=null}}),new Wtf.Button({cls:"button11",text:"Create Calendar",id:this.parent.id+"create",handler:this.createcal,scope:this})]}));this.parent.doLayout()},Addfield:function(){var C=new Wtf.data.SimpleStore({fields:["abbr","state"],data:Wtf.form.ComboBox.sharing});if(!Wtf.StoreMgr.containsKey("timezone")){Wtf.timezoneStore.load();Wtf.StoreMgr.add("timezone",Wtf.timezoneStore)}if(!Wtf.StoreMgr.containsKey("country")){Wtf.countryStore.load();Wtf.StoreMgr.add("country",Wtf.countryStore)}Wtf.Ajax.request({url:"jspfiles/cal/caltree.jsp",params:{action:7},method:"POST",scope:this,success:function(G,F){var H=Wtf.decode(G.responseText);Wtf.getCmp(this.parent.id+"timezone").setValue(H.timezone);Wtf.getCmp(this.parent.id+"country").setValue(H.country)},failure:function(G,F){}});var B=new Wtf.data.SimpleStore({fields:["abbr","resourcename"],data:Wtf.form.ComboBox.resourcename});Wtf.ux.comboBoxRenderer=function(F){return function(H){var G=F.store.find(F.valueField,H);var I=F.store.getAt(G);return I.get(F.displayField)}};var E=new Wtf.form.ComboBox({selectOnFocus:true,triggerAction:"all",editable:false,mode:"local",store:B,displayField:"resourcename",valueField:"abbr"});var D=new Wtf.grid.EditorGridPanel({id:this.parent.id+"gridpanel",clicksToEdit:1,selModel:new Wtf.grid.RowSelectionModel(),ds:new Wtf.data.Store({id:this.parent.id+"datastore",reader:new Wtf.data.ArrayReader({},[{name:"Email"},{name:"userid"},{name:"resourcename"},{name:"setbutton"}])}),cm:new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{header:"Name",dataIndex:"fullname"},{header:"Email",dataIndex:"Email"},{header:"Permission",dataIndex:"resourcename",editor:E,renderer:Wtf.ux.comboBoxRenderer(E)},{header:"User Id",dataIndex:"userid",hidden:true},{header:"Delete",renderer:this.setbutton,dataIndex:"setbutton",width:20}]),viewConfig:{forceFit:true,autoFill:true},height:95});var A=Wtf.getCmp("contactsview");Wtf.getCmp(this.parent.id+"innerpanel").add(new Wtf.FormPanel({id:this.parent.id+"inner1",labelWidth:130,items:[{xtype:"fieldset",title:"Details",autoHeight:true,items:[{fieldLabel:"Calendar Name*",xtype:"textfield",id:this.parent.id+"calname",width:"98%",allowBlank:false},{xtype:"textarea",fieldLabel:"Description",id:this.parent.id+"des",width:"98%"},new Wtf.form.ComboBox({fieldLabel:"Country",editable:false,id:this.parent.id+"country",store:Wtf.countryStore,displayField:"name",valueField:"id",typeAhead:true,mode:"local",triggerAction:"all",selectOnFocus:true,anchor:"71%"}),new Wtf.form.ComboBox({editable:false,fieldLabel:"Time Zone",id:this.parent.id+"timezone",store:Wtf.timezoneStore,displayField:"name",valueField:"id",mode:"local",triggerAction:"all",selectOnFocus:true,anchor:"71%"}),new Wtf.Panel({height:60,xtype:"fieldset",layout:"column",items:[{layout:"form",width:135,items:{labelWidth:130,fieldLabel:"Color",id:"textField",hideField:true,xtype:"textfield"}},{width:150,items:[new Wtf.ColorPalette({cls:"palette",value:"CC3333",id:this.parent.id+"selectColor",colors:["CC3333","DD4477","994499","6633CC","336699","3366CC","22AA99","329262","109618","66AA00","AAAA11","D6AE00","EE8800","DD5511","A87070","8C6D8C","627487","7083A8","5C8D87","898951","B08B59"]})]}]})]},{xtype:"fieldset",title:"Sharing",height:170,id:this.parent.id+"sharingfield",items:[{id:this.parent.id+"pqrs",layout:"column",items:[{columnWidth:0.715,labelWidth:130,layout:"form",items:[new Wtf.form.ComboBox({editable:false,fieldLabel:"User Name",emptyText:"< Select the user name >",id:this.parent.id+"person",store:A.contactStore,displayField:"username",valueField:"userid",mode:"local",triggerAction:"all",selectOnFocus:true,anchor:"100%"})]},{columnWidth:0.1,layout:"form",items:[new Wtf.Template("<table id="+this.parent.id+"addedperson><tr>","<td><img  id="+this.parent.id+'addperson src="images/tabicons_02.gif" title="ADD PERSON" class = "addpersonbutton""></img></td></tr></table>')]}]},{border:false,id:this.parent.id+"mailGridPanel",height:110,layout:"border",items:[{height:100,region:"center",layout:"fit",items:D}]}]}]}));if(this.parent.calTree.ownerid.type==2){Wtf.getCmp(this.parent.id+"sharingfield").hide()}this.parent.doLayout();Wtf.getCmp(this.parent.id+"gridpanel").on("afteredit",this.remGridClass,this);Wtf.get(this.parent.id+"addperson").on("click",this.addshareperson,this);Wtf.get("textField").hide();Wtf.getCmp(this.parent.id+"selectColor").on("select",function(G,F){this.colorInd=G.colors.indexOf(F)},this)},remGridClass:function(A){Wtf.get(Wtf.getCmp(this.parent.id+"gridpanel").getView().getCell(A.row,A.column)).removeClass("x-grid3-dirty-cell")},setbutton:function(){return("<img src='images/Delete.gif'  id=_delbutton  title='Delete Person' class='xbtn'></img>")},addshareperson:function(){var A=Wtf.getCmp(this.parent.id+"gridpanel").store;var H=/^[^@]+@[^@]+.[a-z]{2,}$/i;var F=Wtf.getCmp(this.parent.id+"person").getValue();var J=Wtf.get(this.parent.id+"person").getValue();if(J=="< Select the user name >"){msgBoxShow(["Warning","Select user name"]);return 0}var I=Wtf.getCmp("contactsview");var K=I.contactStore.find("userid",F);var B=I.contactStore.getAt(K);if(B){var E=B.data["emailid"];var C=B.data["userid"];var D=Wtf.data.Record.create({name:"username"},{name:"Email"},{name:"userid"},{name:"resourcename"},{name:"setbutton"});var G=new D({fullname:J,Email:E,userid:F,resourcename:1,setbutton:""});C=this.checkRepeatMail(C);if(C==null){A.add(G)}Wtf.get("_delbutton").on("click",this.deleteClick,this)}},checkRepeatMail:function(A){var B=Wtf.getCmp(this.parent.id+"gridpanel").store;for(i=0;i<B.getCount();i++){if(A==B.getAt(i).data["userid"]){Wtf.Msg.alert("Error","User already Present");return(A)}}A=null;return(A)},deleteClick:function(D){var A=Wtf.getCmp(this.parent.id+"gridpanel");var B=A.getSelectionModel();var C=B.getSelections();var E=A.getStore();Wtf.MessageBox.confirm("Confirm Delete","Are you sure you want to delete?",function(F){if(F=="yes"){E.remove(C[0])}})},displaySettingValues:function(rec){Wtf.getCmp(this.parent.id+"create").setText("Edit Calendar");Wtf.getCmp(this.parent.id+"calname").setValue(rec[1]);Wtf.getCmp(this.parent.id+"des").setValue(rec[2]);Wtf.getCmp(this.parent.id+"country").setValue(rec[3]);Wtf.getCmp(this.parent.id+"timezone").setValue(rec[4]);var colorfield=["CC3333","DD4477","994499","6633CC","336699","3366CC","22AA99","329262","109618","66AA00","AAAA11","D6AE00","EE8800","DD5511","A87070","8C6D8C","627487","7083A8","5C8D87","898951","B08B59"];Wtf.getCmp(this.parent.id+"selectColor").select(colorfield[rec[5]]);Wtf.Ajax.request({url:Wtf.req.cal+"caltree.jsp",method:"GET",params:({action:4,cid:this.selNodeId,caltype:this.parent.calTree.ownerid.type}),scope:this,success:function(result,req){var nodeobj=eval("("+result.responseText.trim()+")");var Grid=Wtf.getCmp(this.parent.id+"gridpanel");var mailStore=Grid.getStore();var mailRecord=Wtf.data.Record.create([{name:"username"},{name:"Email"},{name:"userid"},{name:"resourcename"},{name:"setbutton"}]);var contacts=Wtf.getCmp("contactsview");for(var i=0;i<nodeobj.data.length;i++){var contactCheck=contacts.contactStore.find("userid",nodeobj.data[i].userid);if(contactCheck!=-1){var p=new mailRecord({fullname:contacts.contactStore.getAt(contactCheck).get("username"),Email:contacts.contactStore.getAt(contactCheck).get("emailid"),userid:contacts.contactStore.getAt(contactCheck).get("userid"),resourcename:nodeobj.data[i].permissionlevel,setbutton:""});mailStore.add(p)}if(Wtf.get("_delbutton")){Wtf.get("_delbutton").on("click",this.deleteClick,this)}}},failure:function(){Wtf.Msg.alert("Error","Error occurred while connecting to the server")}})}})