1
我在extjs 4.2.1中有一個網格面板,我在其上使用ftype rowbody向每一行添加其他元素。在這種情況下,我正在爲每行添加一行按鈕(標籤)。Extjs網格與rowbody按鈕處理程序
features: [{
ftype: 'rowbody',
getAdditionalData: function(data, idx, record, orig) {
var headerCt = this.view.headerCt
var colspan = headerCt.getColumnCount()
var rowData = ''
record.data.tags.forEach(function(tag) {
rowData += '<button class="tagDiv">' + tag.name + '</button>'
})
// Usually you would style the my-body-class in CSS file
return {
rowBody: rowData,
rowBodyCls: 'tagRow',
rowBodyColspan: colspan
}
}
}, {
ftype: 'rowwrap'
}],
所以標籤在行中正確顯示,但我想添加監聽器(點擊處理程序)到這些單獨的標籤。這是可能的使用rowbody或者我應該使用其他方法添加這些標記