我只是注意到这Ext.get('myElement').getAttribute('class')
不适用于 IE8-。有没有人有一个优雅的选择(ExtJS 4.1.1 本机或补丁首选)?也许这个功能隐藏在框架的某个地方?
编辑
这是上下文。我暂时解决了这样的问题:
action.getAttribute('class') || action.dom.className
查看(网格):
{
xtype: 'actioncolumn',
items: [{
icon: '/images/edit.png',
iconCls: 'action-edit'
}, {
icon: '/images/delete.png',
iconCls: 'action-delete'
}]
}
控制器 :
init: function () {
this.control({
'grid actioncolumn': {
click: function (a, b, c, d, ev, record) {
var action = Ext.get(ev.target);
if (action.is('img')) {
action = action.getAttribute('class') || action.dom.className;
action = action.match(/action-(.+)/)[1];
this[action + 'Action'](record);
}
}
}
});
},
editAction: function (record) {
// ...
},
deleteAction: function (record) {
// ...
}