您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > ExtJs 页面布局三
ExtJs页面布局三主要是看一下里面的复选框是如何实现的---------------------------------------------------------------------------------------------//判断是否存在此对象,如果不存在则新建,否则直接返回var_showpanel=Ext.getCmp(this.genId(main));if(_showpanel){return_showpanel;}var_this=this;var_buyASendB=1;//买A送B优惠var_buyNAandMB=2;//买NA+MB则优惠var_numberN=3;//第N件优惠var_limitTime=4;//限时优惠/***以下参数是从参数页面传递过来的*/var_promopacktype=null;//促销类型var_querytype=null;//查询日期类型var_begindate=null;//起始日期var_enddate=null;//结束日期var_status=null;//促销方案状态var_promopackname=null;//促销方案名称var_promopackid=null;//促销单号var_corpcode=null;//门店编号var_corpname=null;//门店名称var_articlasscode=null;//分类编号var_articlassname=null;//分类名称var_brandcode=null;//品牌编号var_brandname=null;//品牌名称var_articode=null;//商品编号var_artiname=null;//商品名称//销售综合查询主表varpromopackMStore=newExt.data.JsonStore({url:data/promopack1.txt,root:data,fields:[{name:promopacktype,type:string},{name:promopackname,type:string},{name:begindate,type:string},{name:enddate,type:string},{name:begintime,type:string},{name:endtime,type:string},{name:promopackqty,type:string},{name:pmon,type:string},{name:ptue,type:string},{name:pwed,type:string},{name:pthu,type:string},{name:pfri,type:string},{name:psat,type:string},{name:psun,type:string},{name:pmem,type:string},{name:status,type:string},{name:promopackid,type:string},{name:optrid,type:string},{name:ortrtime,type:string},{name:checkid,type:string},{name:checktime,type:string},{name:ROWNUMCNT,type:string},{name:ROW1,type:string}],listeners:{scope:this,beforeload:function(sto,obj){sto.baseParams.promopacktype=_promopacktype;sto.baseParams.promopackid=_promopackid;sto.baseParams.uerytype=_querytype;//查询日期类型sto.baseParams.begindate=_begindate;//起始日期sto.baseParams.enddate=_enddate;//结束日期sto.baseParams.status=_status;//促销方案状态sto.baseParams.promopackname=_promopackname;//促销方案名称sto.baseParams.corpcode=_corpcode;//门店编号sto.baseParams.corpname=_corpname;//门店名称sto.baseParams.articlasscode=_articlasscode;//分类编号sto.baseParams.articlassname=_articlassname;//分类名称sto.baseParams.brandcode=_brandcode;//品牌编号sto.baseParams.brandname=_brandname;//品牌名称sto.baseParams.articode=_articode;//商品编号sto.baseParams.artiname=_artiname;//商品名称}}});this.mainRocord=null;varmainOthgrpcode=null;//组类型var_grptypeData=[['1','购买'],['2','优惠'],['3','例外']];var_grptypeStore=newExt.data.SimpleStore({data:_grptypeData,fields:['value','text']});var_grptypeComboBox=newExt.form.ComboBox({store:_grptypeStore,displayField:'text',valueField:'value',mode:'local',id:this.genId('grptypecombobox'),name:'grptypecombobox',triggerAction:'all',width:120,allowBlank:false,editable:false,emptyText:'请选择...',listeners:{change:function(){}}});//组号var_corpcodeField=newExt.form.NumberField({id:_this.genId('corpcodefield'),name:'corpcodefield',enableKeyEvents:true,listeners:{keyup:function(src,evt){varval=src.getValue().toString().replace(/\D/g,'');src.setValue(val);}}});//促销方式var_promotypeData=[['1','价格'],['2','折扣']];var_promotypeStore=newExt.data.SimpleStore({data:_promotypeData,fields:['value','text']});var_promotypeComboBox=newExt.form.ComboBox({store:_promotypeStore,displayField:'text',valueField:'value',mode:'local',id:_this.genId('promotypecombobox'),name:'promotypecombobox',triggerAction:'all',width:120,allowBlank:false,editable:false,emptyText:'请选择...'});//数量条件var_saleqtyField=newExt.form.NumberField({id:_this.genId('saleqtyfield'),name:'saleqtyfield',enableKeyEvents:true,listeners:{keyup:function(src,evt){varval=src.getValue().toString().replace(/\D/g,'');src.setValue(val);}}})//促销值var_promopriceField=newExt.form.NumberField({fieldLabel:'门店编号',id:_this.genId('promopricefield'),name:'promopricefield',enableKeyEvents:true,listeners:{keyup:function(obj,evt){varval=src.getValue().toString().replace(/[^\d\.]/g,'');src.setValue(val);}}})//添加商品_this.fn_addgoods=function(){alert('goods');};//添加分类_this.fn_addtype=function(){alert('type');};//添加品牌_this.fn_addbrand=function(){alert('brand');}//添加商品按钮var_addGoods=newExt.Button({xtype:button,text:添加商品,id:_this.genId('addGoods'),icon:image/chaxun.png,handler:_this.fn_addgoods})//添加分类按钮var_addType=newExt.Button({xtype:button,text:添加分类,id:_this.genId('addType'),icon:image/chaxun.png,handler:_this.fn_addtype})//添加品牌var_addBrand=newExt.Button({xtype:button,text:添加品牌,id:_this.genId('addBrand'),icon:image/chaxun.png,handler:_this.fn_addbrand});varpromopackMCheckbox=newExt.grid.CheckboxSelectionModel({checkOnly:false,singleSelect:true,listeners:{scope:this,rowselect:function(opt,rowIndex,record){_this.mainRocord=promopackMgrid.getSelectionModel().getSelected();if(record){_promopackid=record.get('promopackid');_promopacktype=record.get('promopacktype')}promopack2Store.load({params:{start:0,limit:gLimit}});promopack3Store.load({params:{start:0,limit:gLimit}});/**第一组:买A送B优惠*/if(_promopacktype==_buyNAandMB){}/**第二组:MA+NB优惠,则添加分类,添加品牌按钮无效*/if(_promopacktype==_buyNAandMB){_addType.hide();_addBrand.hide();}/**第三组:第N件优惠,则添加分类,添加品牌按钮无效*/if(_promopacktype==_numberN){_addType.hide();_addBrand.hide();}/**第四组:限时优惠*/if(_promopacktype==_buyNAandM
本文标题:ExtJs 页面布局三
链接地址:https://www.777doc.com/doc-3265221 .html