- 0
- 0
- 约3.41千字
- 约 15页
- 2017-09-01 发布于江苏
- 举报
* * * * * * * * * 第十一课 模板高级用法 本课目标 Ext模板的高级用法方法:两个具体实例 例1:自制留言板 Ext.onReady(function(){ var msgs=[ {name:漠漠1,headImgSrc:img.jpg,content:大漠穷秋塞草衰,孤城落日斗兵稀。} //更多诗句留给你自己去发挥 ]; var msgTpl=new Ext.XTemplate( div style=padding:10px;text-align:center, table class=dataTabel, tpl for=., tr, td width=20%img src={headImgSrc} with=50 height=50/{name}:/td, td width=80%{content}/td, /tr, /tpl, /table ); var win=new Ext.Window({ title:留言板, width:600, height:400, autoScroll:true, items:[{ xtype:panel, listeners:{ render:function(){ msgTpl.append(this.body,msgs); } } }]}); win.show(); }); 例2:酷炫的DataView var store = new Ext.data.ArrayStore({ proxy : new Ext.data.MemoryProxy(), fields : [hasEmail, hasCamera, id, name, price, screen, camera, color, type, reviews, screen-size], sortInfo: { field : name, direction: ASC } }); store.loadData([ [true, false, 1, LG KS360, 54, 240 x 320 pixels, 2 Megapixel, Pink, Slider, 359, 2.400000] //这里是更多数据 ]) var dataview = new Ext.DataView({ store: store, tpl : new Ext.XTemplate( ul, tpl for=., li class=phone, img width=64 height=64 src=images/phones/{[values.name.replace(/ /g, -)]}.png /, strong{name}/strong, span{price:usMoney} ({reviews} Review{[values.reviews == 1 ? : s]})/span, /li, /tpl, /ul ), plugins : [ new Ext.ux.DataViewTransition({ duration : 550, idProperty: id }) ], id: phones, itemSelector: li.phone, overClass : phone-hover, singleSelect: true, multiSelect : true, autoScroll : true }); var phoneSlider =
您可能关注的文档
最近下载
- 天津市部分区2024-2025学年八年级上学期11月期中数学试题(解析版).docx VIP
- 会议活动策划方案模板.docx VIP
- 土方意向协议书范本.docx VIP
- 履带吊安拆监理细则.docx VIP
- T_ZZB 2614-2022 BD100生物柴油标准.docx VIP
- 2026领导班子成员民主生活会“五个带头”个人对照检查材料8篇.docx VIP
- 2025年度民主生活会个人对照检查发言材料.docx VIP
- 山东省烟台龙口市(五四制)2022-2023学年六年级上学期期末考试数学试题(含答案).docx VIP
- 部编版七年级语文上册第三单元第9课时_主题阅读:有为有不为.docx VIP
- 《人工智能辅助的翻译技术》课件.ppt VIP
原创力文档

文档评论(0)