Ext.define("optionsfavoritereports.view.FavoriteSharingList",{extend:"utilities.CustomGrid",requires:["Ext.ux.grid.FiltersFeature","Ext.ux.data.PagingMemoryProxy"],alias:"widget.favoritesharinglistgrid",id:"favoriteSharingListGrid",ui:"newGridPanel withHeader withShade",border:true,screenLabels:null,dataArray:null,dummyArray:null,pageLimit:2,margin:"0 10 10 10",padding:"0 10 10 10",flex:1,emptyText:"",activePage:1,initComponent:function(){var b={ftype:"filters",encode:false,local:true,filters:[{dataIndex:"FavoriteName",type:"string"},{dataIndex:"userName",type:"string"},{dataIndex:"ReportType",type:"string"},{dataIndex:"CreationTime",type:"string"}]};
this.features=[b];this.selModel=new Ext.selection.CheckboxModel({checkOnly:true,headerWidth:26,injectCheckbox:"first"});this.dummyArray=this.dataArray.slice();this.store=Ext.create("Ext.data.Store",{fields:["FavoriteName","favID","favSharingHrefUrl","userName","ReportType","CreationTime"],proxy:{type:"pagingmemory",reader:{type:"json"}},pageSize:this.pageLimit,data:this.dataArray,id:"tmpStore"});
this.columns=[{dataIndex:"FavoriteName",header:this.screenLabels["reporter.common.FAVORITE NAME"],sortable:true,flex:2,renderer:function(i,d,h,k,f,j,c){var g=i;var e=h.get("favSharingHrefUrl");if(!Ext.isEmpty(e)&&e!="-"){g='<a href="'+e+'">'+i+"</a>";}return g;}},{dataIndex:"userName",header:this.screenLabels["reporter.common.SHARED BY"],flex:2,sortable:true,renderer:function(g,d,c,i,f,e,h){return g;
}},{dataIndex:"ReportType",header:this.screenLabels["reporter.common.REPORT TYPE"],flex:1,sortable:true,renderer:function(g,d,c,i,f,e,h){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}g=appConstants.erUtils.specialCharDecode(g);return g;}},{dataIndex:"CreationTime",header:this.screenLabels["reporter.common.CREATION TIME"],flex:0.75,sortable:false,align:"center",renderer:function(g,d,c,i,f,e,h){return g;
}}];var a=this;this.dockedItems=[{xtype:"pagingtoolbar",cls:"newPagination",dock:"bottom",displayInfo:true,id:"FavSharingListPaging",name:"FavSharingListPaging",pageSize:this.pageLimit,store:this.store,displayInfo:true,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No topics to display",listeners:{change:function(c,d){if(!Ext.isEmpty(d)){a.activePage=d.currentPage;
}else{a.activePage=0;}}}},{xtype:"toolbar",cls:"toolbar",items:[{xtype:"container",items:[{xtype:"button",id:"showHiddenReports",ui:"newButtonSmall",margin:5,hidden:true,name:"showHiddenReports",text:this.screenLabels["reporter.common.Show Hidden Favorites"]},{xtype:"button",id:"HideReports",ui:"newButtonSmall",name:"HideReports",text:this.screenLabels["reporter.common.Hide Selected Favorites"]}]}]}];
this.callParent();},listeners:{sortchange:function(c,d,f,b,a){console.log("yyyyyyyyy   "+this.activePage);this.getStore().loadPage(this.activePage);},}});