I am new for sencha touch. I got a question.How can I add button and fire the even to item template?Please guild me solution
Here is my coding
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}°<span class="temp_low">{memberId}°</span></span>',
'button here?????'
'</div>',
'</tpl>',
'</div></div>'
),
},
});
Btw i am using MVC model.Thanks in advance
List templates are not designed to use components, however you should be able to use them in dataviews. Another method is to add a div for the button to your template, and then using member functions on the template you can create and render a button to the div.