如何添加Sencha Touch Button到 Sencha Touch List有项目模板吗?
我知道,我可以做这样的事情:
itemTpl: '{quantity} {productName} <input type="button" value="Delete" />',
但是这个按钮看起来很奇怪又丑陋,我想让这个按钮与 Sencha Button 具有相同的 ui 。 .
确定您单击的行或按钮是否适用于以下代码:
config: {
control: {
'list[itemId="listItemId"]': {
itemtap: 'yourFunction'
}
}
},
yourFunction: function(list, index, target, record, evt) {
var type = evt.event.target.type || '';
if(type == 'button') {
console.warn('delete');
}
}
最佳答案
您可能应该使用Ext.dataview.DataView使用useComponent: true
。然后,您可以将 defaultType
配置设置为您自己的自定义数据项。
看看 dataview guide 中的“Component DataView” .
关于javascript - 如何将 sencha 按钮添加到 sencha 列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18003748/