Sencha Touch ボタンをデータ ビュー リストに追加したいのですが、そのボタンのタップ イベントでいくつかの関数が呼び出されます。
このような :
アイテム 1 ボタン 1 アイテム 2 ボタン 2 アイテム 3 ボタン 3
Sencha Touch ボタンをデータ ビュー リストに追加したいのですが、そのボタンのタップ イベントでいくつかの関数が呼び出されます。
このような :
アイテム 1 ボタン 1 アイテム 2 ボタン 2 アイテム 3 ボタン 3
DataItem を使用できます: http://docs.sencha.com/touch/2.3.0/#!/api/Ext.dataview.component.DataItem
// The dataview
Ext.define('MyDataView', {
extend: 'Ext.dataview.DataView',
config: {
defaultType: 'mydataitem',
useComponents: true
}
});
// The dataitem
Ext.define('MyDataItem', {
extend: 'Ext.dataview.component.DataItem',
alias: 'widget.mydataitem',
config: {
layout: {
type: 'hbox'
},
items: [{
xtype: 'component',
flex: 1,
html: 'val1',
itemId: 'textCmp'
},{
xtype: 'button',
text: 'Val2'
}]
},
updateRecord: function(record) {
this.down('#textCmp').setHtml(record.get('val1'));
this.down('button').setText(record.get('val2'));
this.callParent(arguments);
}
});