
Extjs4简单问题
他们并没有配置id,怎么在controller层分别获取这二个actiion的点击事件,???columns:[{text:'FirstName',dataIndex:'...
他们并没有配置id,怎么在controller层分别获取这二个actiion的点击事件,???
columns: [ {text: 'First Name', dataIndex:'firstname'}, {text: 'Last Name', dataIndex:'lastname'}, { xtype:'actioncolumn', width:50, items: [{ icon: 'images/edit.png', // Use a URL in the icon config tooltip: 'Edit', handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Edit " + rec.get('firstname')); } },{ icon: 'images/delete.png', tooltip: 'Delete', handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Terminate " + rec.get('firstname')); } }] } ], 展开
columns: [ {text: 'First Name', dataIndex:'firstname'}, {text: 'Last Name', dataIndex:'lastname'}, { xtype:'actioncolumn', width:50, items: [{ icon: 'images/edit.png', // Use a URL in the icon config tooltip: 'Edit', handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Edit " + rec.get('firstname')); } },{ icon: 'images/delete.png', tooltip: 'Delete', handler: function(grid, rowIndex, colIndex) { var rec = grid.getStore().getAt(rowIndex); alert("Terminate " + rec.get('firstname')); } }] } ], 展开
1个回答
展开全部
你太幸运了,我刚做完这类似的,其实是获取他们的头部的id组件,不是这2个的
从而获取当下的例如:
var operItem = Ext.getCmp('operItem');
operItem.items[0].handler = function(){
// TODO
};
operItem.items[1].handler = function(){
// TODO
};
把这些放在onLaunch函数里面执行
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询