第十一课+模板高级用法.pptVIP

  • 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 =

文档评论(0)

1亿VIP精品文档

相关文档