2012-12-30 78 views
0

我是sencha touch的新手。我有一个question.How可我添加按钮,火甚至项模板?请公会我的解决方案将按钮添加到itemTpl sencha touch

这里是我的编码

 Ext.define('bluebutton.view.BlueButton.CouponList', { 
     extend: 'Ext..DataView', 
     xtype: 'couponlistcard', 
     requires: [ 
      'Ext.field.Select', 
      'Ext.field.Search', 
      'bluebutton.view.BlueButton.MemberDetail', 
      'Ext.plugin.ListPaging', 
      'Ext.plugin.PullRefresh' 

     ], 
     config: { 

      styleHtmlContent: true, 
      scrollable: 'vertical', 

      store : { xclass : 'bluebutton.store.BlueButton.MemberList'}, 
      grouped: true, 
      indexBar: true, 
      autoLoad: false, 
      disclosure: true, 
      cls:'customHeader', 

      id :'memberlist', 
      items: [ 
       { 



       } 

      ], 
      emptyText: '<p class="no-search-results">No member record found matching that search</p>', 
      itemTpl: Ext.create(
       'Ext.XTemplate', 

    '<div style="float:left;width=33%;margin:2px;"><div class="demo-weather">', 
          '<tpl for=".">', 
           '<div class="day">', 
            '<div class="date">{memberId}</div>', 
            '<tpl for="weatherIconUrl">', 
             '<img src="{value}">', 
            '</tpl>', 
            '<span class="temp">{memberId}&deg;<span class="temp_low">{memberId}&deg;</span></span>', 
            'button here?????' 
           '</div>', 
          '</tpl>', 
         '</div></div>' 





      ), 



     }, 


    }); 

顺便说一下我在提前使用MVC model.Thanks

回答

0

列表模板并非设计用于使用组件,但是您应该能够在数据视图中使用它们。另一种方法是将按钮的div添加到模板,然后使用模板上的成员函数创建并向div呈现按钮。

相关问题