Hi, I facing a problem nw. I need to show some data from datastore to tpl on a panel. But cant find any solution about this. Please guild me some example. Btw i am using mvc modal
Here is my code
Code:
Ext.define('bluebutton.view.BlueButton.CouponList', { extend: 'Ext.Panel',
xtype: 'couponlistcard',
id :'couponlistcard',
requires: [
'Ext.field.Select',
'Ext.field.Search',
'Ext.plugin.ListPaging',
'Ext.plugin.PullRefresh',
],
config: {
styleHtmlContent: true,
scrollable: 'vertical',
itemHeight :20,
variableHeights : false,
grouped: true,
indexBar: true,
autoLoad: false,
disclosure: true,
plugins: [
//
// { xclass: 'Ext.plugin.PullRefresh',
// refreshFn: function() {
// Ext.getStore('couponlist').load();
// },
//
// }
],
emptyText: '<p class="no-search-results">No Member record found matching that search</p>',
},
});
Here is my data store
Code:
Ext.define('bluebutton.store.BlueButton.Coupon', { extend: 'Ext.data.Store',
config: {
grouper: {
groupFn: function (record) {
return record.get('transaction_date');
}
},
fields: ['transaction_id', 'user_id', 'content', 'imgUrl', 'transaction_description', 'transaction_date', 'transaction_time', 'reffernce_no', 'point', 'status'],
pageSize: 5,
autoLoad: false,
storeId: 'transactionlist1',
sorters: 'transaction_date',
groupDir: 'DESC',
data:
[
{
transaction_id: 'T0342342343',
reffernce_no: 'R001',
user_id: 'Anthony Tan',
imgUrl: '/bluebutton/resources/images/voucher.jpg',
transaction_description: 'Old town promotion buy 3 free 1',
transaction_date: '26/11/2012',
transaction_time: '11:52 AM',
point: '10',
status: 'Add',
content: '<div><i>this is what you think but not what you want. </i></div>'
},
{
transaction_id: 'T0002',
reffernce_no: 'R002',
user_id: 'Kenny',
imgUrl: '/bluebutton/resources/images/voucher.jpg',
transaction_description: 'KFC promotion 10% dicount',
transaction_date: '27/11/2012',
transaction_time: '11:00 AM',
point: '12',
status: 'Redeem',
content: '<div><i>this is what you think but not what you want. </i></div>'
},
{
transaction_id: 'T0003',
user_id: 'Alex',
reffernce_no: 'R003',
imgUrl: '/bluebutton/resources/images/voucher.jpg',
transaction_description: 'Mcd Promotion buy 3 burger free 1',
transaction_date: '29/11/2012',
transaction_time: '05:04 AM',
point: '20',
status: 'Add',
content: '<div><i>this is what you think but not what you want. </i></div>'
},
{
transaction_id: 'T0004',
user_id: 'user1',
reffernce_no: 'R004',
imgUrl: '/bluebutton/resources/images/voucher.jpg',
transaction_description: 'Under Promotion buy 3 free 1',
transaction_date: '30/11/2012',
transaction_time: '07:08 AM',
point: '26',
status: 'Add',
content: '<div><i>this is what you think but not what you want. </i></div>'
}
]
}
});
Hw can i extract the data to the tpl? btw i also need to add a button to tpl. thanks