【问题标题】:Add button to itemTpl sencha touch将按钮添加到 itemTpl sencha touch
【发布时间】:2012-12-30 21:16:46
【问题描述】:

我是煎茶触摸的新手。我有一个问题。如何添加按钮并触发事件模板?请指导我解决方案

这是我的代码

     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 模型。提前致谢

【问题讨论】:

    标签: button sencha-touch-2 dataview


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多