Extjs 4 动作列问题

Extjs 4 actioncolumn issue

我有一件 Ext.grid.Panel 物品:

items:[
                   {
                           xtype:'actioncolumn', 
                           width:20,
                           align:'center',
                           items: [
                                   {
                                       icon:'resources/images/icons/table_edit.png',
                                       tooltip: 'Edita Registro',
                                       action:'edit'
                                   },
                           ]
                   },
                   {header:'<span style="color:blue;">Estado</span>', dataIndex:'testado', width:90},
                   {header:'<span style="color:blue;">Cliente</span>', dataIndex:'tcliente', width:110, sortable: true},
                   {header:'<span style="color:blue;">N&#176; Expediente</span>', dataIndex:'Expediente', width:100},
                   {header:'<span style="color:blue;">Organismo</span>', dataIndex:'torganismo', width:255, sortable: true},
                   {header:'<span style="color:blue;">Convocatoria</span>', dataIndex:'F_Convocatoria', width:80, sortable: true},
                   {header:'<span style="color:blue;">Presentacion</span>', dataIndex:'F_Presentacion', width:80, sortable: true},
                   {header:'<span style="color:blue;">Aviso</span>', dataIndex:'F_Aviso', width:80, sortable: true},
                   {header:'<span style="color:blue;">Importe sin IVA</span>', dataIndex:'Total_Licitacion_sIVA', width:105, sortable: true},
                   {header:'<span style="color:blue;">Responsable</span>', dataIndex:'tresponsable', width:140, sortable: true},
            ]

在我的控制器中,我想在用户单击 actioncolumn 的按钮时进行处理。我有以下代码:

this.control({
    'viewGridRECO actioncolumn':{
        click:this.onPulsarEditar
    }
});

在我的控制器中使用之前的代码,当用户在操作列的单元格中的任何地方单击时执行 onPulsarEditar 函数,但我希望它仅在单击按钮时执行,而不是在操作列的单元格中的所有位置操作栏。

我试过将 action:'edit' 属性 放在按钮和控制器中:

this.control({
    'viewGridRECO actioncolumn button[action=edit]':{
        click:this.onPulsarEditar
    }
});

然后什么也没发生。

正如 @Abdul Rehman Yawar Khan 评论查看 post,更新我的代码后它是:

在视图中,column items:

items:[
                   {
                           xtype:'actioncolumn', 
                           width:20,
                           align:'center',
                           items: [
                                   {
                                       icon:'resources/images/icons/table_edit.png',
                                       tooltip: 'Edita Registro',
                                       handler: function(view, rowIndex, colIndex, item, e, record, row) {
                                            this.fireEvent('itemClick', view, rowIndex, colIndex, item, e, record, row, 'edit');
                                       }
                                   }
                           ]
                   },
                   {header:'<span style="color:blue;">Estado</span>', dataIndex:'testado', width:90},
                   {header:'<span style="color:blue;">Cliente</span>', dataIndex:'tcliente', width:110, sortable: true},
                   {header:'<span style="color:blue;">N&#176; Expediente</span>', dataIndex:'Expediente', width:100},
                   {header:'<span style="color:blue;">Organismo</span>', dataIndex:'torganismo', width:255, sortable: true},
                   {header:'<span style="color:blue;">Convocatoria</span>', dataIndex:'F_Convocatoria', width:80, sortable: true},
                   {header:'<span style="color:blue;">Presentacion</span>', dataIndex:'F_Presentacion', width:80, sortable: true},
                   {header:'<span style="color:blue;">Aviso</span>', dataIndex:'F_Aviso', width:80, sortable: true},
                   {header:'<span style="color:blue;">Importe sin IVA</span>', dataIndex:'Total_Licitacion_sIVA', width:105, sortable: true},
                   {header:'<span style="color:blue;">Responsable</span>', dataIndex:'tresponsable', width:140, sortable: true},
            ]

在控制器中:

this.control({
    'actioncolumn':{
        itemClick:this.onPulsarEditar
});

请注意,控制器中的 actioncolumn itemClick 的编写方式与视图处理程序事件中的编写方式相同。

并且在函数的控制器中 onPulsarEdit 您可以根据需要添加执行该函数所需的所有代码。