资源描述:
《07第七讲:VIP信息查询功能实现.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、商场VIP消费情况查询系统VIP信息查询功能实现一、添加VIP信息查询窗口functionvipQuery(){//创建一个windowvarvipQueryWindow=newExt.Window({title:"VIP信息查询",width:600,height:400,modal:true});vipQueryWindow.show();}按钮事件处理{text:"VIP信息查询",handler:vipQuery},效果预览:二、添加GridPanel//记录类型varvip=Ext.data.Record.cre
2、ate([{name:"vipId",mapping:"vipId"},{name:"name",mapping:"name"},{name:"age",mapping:"age"},{name:"profession",mapping:"profession"},{name:"joinTime",mapping:"joinTime",type:"date",dateFormat:"Y-m-dTH:i:s"}]);//存储器varstore=newExt.data.Store({url:"vipQuery.action",
3、reader:newExt.data.JsonReader({root:"allVIP",id:"vipId",totalProperty:"recordSize"},vip)});vargridPanel=newExt.grid.GridPanel({width:585,height:375,frame:true,store:store,columns:[{header:"VIPID",dataIndex:"vipId",sortable:true},{header:"姓名",dataIndex:"name",sorta
4、ble:true},{header:"年龄",dataIndex:"age",sortable:true},{header:"成分",dataIndex:"profession",sortable:true},{header:"入会时间",dataIndex:"joinTime",sortable:true,renderer:newExt.util.Format.dateRenderer("Y年m月d日")}],autoExpandColumn:2,//分页控制条bbar:newExt.PagingToolbar({pag
5、eSize:10,//每页显示多少条记录store:store,//数据源displayInfo:true,displayMsg:"当前显示第{0}条到{1}条记录,一共有{2}条记录",emptyMsg:"没有任何记录",firstText:"首页",prevText:"上一页",nextText:"下一页",lastText:"尾页",refreshText:"刷新"}),selModel:newExt.grid.RowSelectionModel({singleSelect:false})});store.load(
6、{params:{start:0,limit:10}});效果预览:三、VIP查询Action.packagecom.ibeifeng.action;importjava.util.List;importcom.ibeifeng.dao.VipDAO;importcom.ibeifeng.po.Vip;importcom.opensymphony.xwork2.ActionSupport;publicclassVIPQueryActionextendsActionSupport{privateVipDAOvipDAO;pr
7、ivateListallVIP;privateintstart;privateintlimit;privateintrecordSize;publicVipDAOgetVipDAO(){returnvipDAO;}publicvoidsetVipDAO(VipDAOvipDAO){this.vipDAO=vipDAO;}publicListgetAllVIP(){returnallVIP;}publicvoidsetAllVIP(ListallVIP){this.allVIP=allVIP;}
8、publicintgetStart(){returnstart;}publicvoidsetStart(intstart){this.start=start;}publicintgetLimit(){returnlimit;}publicvoidsetLimit(intlimit){this.limit