关闭

关闭

封号提示

内容

首页 Extjs4 报表式例子2).doc

Extjs4 报表式例子2).doc

Extjs4 报表式例子2).doc

上传者: 早知道是梦一场_ 2017-10-19 评分 5 0 179 24 815 暂无简介 简介 举报

简介:本文档为《Extjs4 报表式例子2)doc》,可适用于IT/计算机领域,主题内容包含Extjs报表式例子)ca()Extjs表格式例子()ExtJsGrid:RemoveSelectedRecordToolbarButtonExto符等。

Extjs报表式例子)ca()Extjs表格式例子()ExtJsGrid:RemoveSelectedRecordToolbarButtonExtonReady(function(){Extdefine('ExtuxDeleteButton',{extend:'ExtbuttonButton',alias:'widgetdelbutton',text:'RemoveSelectedRecord',handler:function(){vargrid=thisup('grid')if(grid){varsm=gridgetSelectionModel()varrs=smgetSelection()if(!rslength){ExtMsgalert('Info','NoRecordsSelected')return}ExtMsgconfirm('RemoveRecord','Areyousure',function(button){if(button=='yes'){gridstoreremove(rs)}})}}})Extcreate('ExtgridPanel',{title:'Simpsons',width:,tbar:{xtype:'delbutton'},store:{fields:'name','email','phone',data:{'name':'Lisa',email:lisasimpsonscom,phone:},{'name':'Bart',email:bartsimpsonscom,phone:},{'name':'Homer',email:homesimpsonscom,phone:}},columns:{header:'Name',dataIndex:'name'},{header:'Email',dataIndex:'email',flex:},{header:'Phone',dataIndex:'phone'},renderTo:'output'})})HowToMakeEveryGridAbleToCreateIt'sOwnStoreInstancePartExtonReady(function(){Extdefine('AppMyStore',{extend:'ExtdataStore',fields:'name','email','phone',data:{'name':'Lisa',email:lisasimpsonscom,phone:},{'name':'Bart',email:bartsimpsonscom,phone:},{'name':'Homer',email:homesimpsonscom,phone:}})Extdefine('AppMyForm',{extend:'ExtwindowWindow',alias:'widgetmyform',title:'Simpsons',width:,layout:'fit',initComponent:function(){varstore=Extcreate('AppMyStore')thisitems={xtype:'grid',store:store,columns:{header:'Name',dataIndex:'name'},{header:'Email',dataIndex:'email',flex:},{header:'Phone',dataIndex:'phone'}}thiscallParent(arguments)}})Extwidget('button',{text:'FirstTestGrid',renderTo:'output',handler:function(){Extwidget('myform',{title:'FirstTestGrid',border:false,autoShow:true})}})Extwidget('button',{text:'SecondTestGrid',renderTo:'output',handler:function(){Extwidget('myform',{title:'SecondTestGrid',border:false,autoShow:true})}})})HowToMakeEveryGridAbleToCreateIt'sOwnStoreInstanceExtonReady(function(){Extdefine('AppMyStore',{extend:'ExtdataStore',fields:'name','email','phone',data:{'name':'Lisa',email:lisasimpsonscom,phone:},{'name':'Bart',email:bartsimpsonscom,phone:},{'name':'Homer',email:homesimpsonscom,phone:}})Extdefine('AppMyGrid',{extend:'ExtgridPanel',alias:'widgetmygrid',title:'Simpsons',width:,initComponent:function(){thisstore=Extcreate('AppMyStore')thiscallParent(arguments)},columns:{header:'Name',dataIndex:'name'},{header:'Email',dataIndex:'email',flex:},{header:'Phone',dataIndex:'phone'}})Extwidget('mygrid',{title:'FirstTestGrid',renderTo:'output'})Extwidget('mygrid',{title:'SecondTestGrid',margin:'',renderTo:'output'})})HideShowGridColumnLinesExtonReady(function(){Extcreate('ExtgridPanel',{title:'Simpsons',width:,tbar:{text:'ShowColumnLines',handler:function(){thisup('grid')setColumnLines(true)}},{text:'HideColumnLines',handler:function(){thisup('grid')setColumnLines(false)}},store:{fields:'name','email','phone',data:{'name':'Lisa',email:lisasimpsonscom,phone:},{'name':'Bart',email:bartsimpsonscom,phone:},{'name':'Homer',email:homesimpsonscom,phone:}},columns:{header:'Name',dataIndex:'name'},{header:'Email',dataIndex:'email',flex:},{header:'Phone',dataIndex:'phone'},renderTo:'output'})})HideShowGrid'sBodyExtonReady(function(){Extcreate('ExtgridPanel',{title:'Simpsons',width:,bodyStyle:'visibility:hidden',tbar:{text:'ShowBody',handler:function(){thisup('grid')bodyshow()}},{text:'HideBody',handler:function(){thisup('grid')bodyhide()}},store:{fields:'name','email','phone',data:{'name':'Lisa',email:lisasimpsonscom,phone:},{'name':'Bart',email:bartsimpsonscom,phone:},{'name':'Homer',email:homesimpsonscom,phone:}},columns:{header:'Name',dataIndex:'name'},{header:'Email',dataIndex:'email',flex:},{header:'Phone',dataIndex:'phone'},renderTo:'output'})})ExtJSReadonlyCheckboxColumnxgridcheckheader{background:url('Contentimagesiconsuncheckedgif')norepeatcentercenter}xgridcheckheaderchecked{background:url('Contentimagesiconscheckedgif')norepeatcentercenter}ExtLoadersetConfig({enabled:true,paths:{'Extux':'Scriptsextextgplux'}})Extrequire('ExtuxCheckColumn')ExtonReady(function(){Extdefine('User',{extend:'ExtdataModel',fields:{name:'id',type:'int'},{name:'name',type:'string'},{name:'active',type:'boolean'}})Extcreate('ExtgridPanel',{title:'Users',width:,store:Extcreate('ExtdataStore',{model:'User',data:{id:,name:'name',active:false},{id:,name:'name',active:true},{id:,name:'name',active:true}}),columns:{header:'id',dataIndex:'id'},{header:'name',dataIndex:'name',flex:},{header:'active',dataIndex:'active',xtype:'checkcolumn',processEvent:function(){returnfalse}},renderTo:'output'})})FilterWindowForGridExtonReady(function(){Extdefine('AppstoreBooks',{extend:'ExtdataStore',fields:'id','title','author',data:{id:,title:'LearningExtJS',author:'SheaFrederick'},{id:,title:'ExtJSProjectswithGears',author:'FrankZammetti'},{id:,title:'ExtJSinAction',author:'JesusDGarcia'},{id:,title:'JavaPrecisely',author:'PeterSestoft'},{id:,title:'MasteringC',author:'KRVenugopal'}})Extdefine('AppviewBooksList',{extend:'ExtgridPanel',alias:'widgetbookslist',title:'BooksList',store:'Books',initComponent:function(){thistbar={text:'Filter',action:'filter',iconCls:'filteradd'}thiscolumns={header:'Id',dataIndex:'id',width:},{header:'Title',dataIndex:'title',flex:},{header:'Author',dataIndex:'author'}thiscallParent(arguments)}})Extdefine('AppviewBooksFilter',{extend:'ExtwindowWindow',alias:'widgetbooksfilter',title:'BooksFilter',width:,layout:'fit',resizable:false,closeAction:'hide',modal:true,items:{xtype:'form',layout:'anchor',bodyStyle:{background:'none',padding:'px',border:''},defaults:{xtype:'textfield',anchor:''},items:{name:'title',fieldLabel:'Title'},{name:'author',fieldLabel:'Author'}},buttons:{text:'OK',action:'filter'},{text:'Reset',handler:function(){thisup('window')down('form')getForm()reset()}},{text:'Cancel',handler:function(){thisup('window')close()}}})Extdefine('AppcontrollerBooks',{extend:'ExtappController',stores:'Books',views:'BooksList','BooksFilter',refs:{ref:'filterWindow',xtype:'booksfilter',selector:'booksfilter',autoCreate:true},init:function(){thiscontrol({'bookslisttoolbarbuttonaction=filter':{click:thisonFilter},'booksfilterbuttonaction=filter':{click:thisdoFilter}})},onFilter:function(){varwin=thisgetFilterWindow()winshow()},doFilter:function(){varwin=thisgetFilterWindow()varstore=thisgetBooksStore()varvalues=windown('form')getValues()varfilters=for(varpinvalues){varvalue=valuespif(value){filterspush({property:p,value:value})}}winclose()if(filterslength){storeclearFilter(true)storefilter(filters)}else{storeclearFilter()}}})Extapplication({name:'App',controllers:'Books',launch:function(){Extwidget('bookslist',{width:,renderTo:'output'})}})})filteradd{backgroundimage:url('contentimagesiconsfilteraddpng')}ProgressBarInsideAGridCellExtonReady(function(){Extcreate('ExtgridPanel',{title:'Simpsons',width:,height:,store:Extcreate('ExtdataStore',{fields:'name','email','phone','progress',data:{'name':'Lisa',email:lisasimpsonscom,phone:,'progress':},{'name':'Bart',email:bartsimpsonscom,phone:,'progress':},{'name':'Homer',email:homesimpsonscom,phone:,'progress':},{'name':'Marge',email:margesimpsonscom,phone:,'progress':}}),columns:{header:'Name',dataIndex:'name'},{header:'Email',dataIndex:'email',flex:},{header:'Phone',dataIndex:'phone'},{header:'Progress',dataIndex:'progress',width:,renderer:function(v,m,r){varid=Extid()Extdefer(function(){Extwidget('progressbar',{renderTo:id,value:v,width:})},)returnExtStringformat('divid={}div',id)}},renderTo:'output'})})HowToChangeAColumnTemplateOnTheRenderedGridColumnJsCodeExtonReady(function(){Extdefine('ExtgridcolumnUpdatableTemplate',{extend:'ExtgridcolumnColumn',alias:'widgetupdatabletemplatecolumn',requires:'ExtXTemplate',constructor:function(cfg){varme=thismecallParent(arguments)metpl=(!ExtisPrimitive(metpl)metplcompile)metpl:Extcreate('ExtXTemplate',metpl)merenderer=function(value,p,record){vardata=Extapply({},recorddata,recordgetAssociatedData())returnmetplapply(data)}},setTemplate:function(tpl){thistpl=Extcreate('ExtXTemplate',tpl)}})Extcreate('ExtgridPanel',{title:'Simpsons',width:,height:,store:{fields:'name','email','phone',data:{'name':'Lisa',email:lisasimpsonscom,phone:},{'name':'Bart',email:bartsimpsonscom,phone:},{'name':'Homer',email:homesimpsonscom,phone:},{'name':'Marge',email:margesimpsonscom,phone:}},tbar:{text:'FirstTemplate',handler:function(){thisup('grid')changeTemplate('name','b{name}b({email})')}},{text:'SecondTemplate',handler:function(){thisup('grid')changeTemplate('name','b{name}b({phone})')}},columns:{header:'Name',dataIndex:'name',xtype:'updatabletemplatecolumn',tpl:'{name}',flex:},changeTemplate:function(column,tpl){ExtArrayeach(thiscolumns,function(item){if(itemdataIndex==column){itemsetTemplate(tpl)returnfalse}})thisgetView()refresh()},renderTo:'output'})})HowAddDynamicButtonInGridPanelColumnUsingRendererJsCodeExtonReady(function(){Extcreate('ExtgridPanel',{title:'Simpsons',width:,height:,store:Extcreate('ExtdataStore',{fields:'name','email','phone',data:{'name':'Lisa',email:lisasimpsonscom,phone:},{'name':'Bart',email:bartsimpsonscom,phone:},{'name':'Homer',email:homesimpsonscom,phone:},{'name':'Marge',email:margesimpsonscom,phone:}}),columns:{header:'Name',dataIndex:'name'},{header:'Email',dataIndex:'email',flex:},{header:'Phone',dataIndex:'phone'},{header:'Buttons',renderer:function(v,m,r){varid=Extid()Extdefer(function(){Extwidget('button',{renderTo:id,text:'Edit:'rget('name'),width:,handler:function(){ExtMsgalert('Info',rget('name'))}})},)returnExtStringformat('divid={}div',id)}},renderTo:'output'})})

类似资料

该用户的其他资料

外伤性腹部内脏伤围手术期护理观察[权威资料].doc

出口核销单申领.doc

去括号解方程2.doc

地下化妆品盯牢大学生代理 买与卖都须慎重.doc

信尔硅丙水性荷叶漆先用国际一流品质有机硅丙烯酸酯乳-5.doc

职业精品

精彩专题

用户评论

0/200
    暂无评论
上传我的资料

精选资料

热门资料排行换一换

  • 中国历代名着全译丛书-韩非子全译…

  • 谷场风波-广东.pdf

  • GJB 481-88 焊接质量控…

  • GJB2366-1995试制过程…

  • 文史通义.pdf

  • 水经注.pdf

  • 慎子.pdf

  • 山海经.pdf

  • 国语.pdf

  • 资料评价:

    / 24
    所需积分:0 立即下载

    意见
    反馈

    返回
    顶部