简体   繁体   English

Extjs-在网格中触发操作列的处理程序

[英]Extjs- Fire the handler of an action column in grid

I have defined a grid and i have an action element in every row of the grid to delete that row. 我已经定义了一个网格,并且网格的每一行都有一个动作元素来删除该行。 Is there a way to fire the handler of that action element in first row without clicking from UI. 有没有一种方法可以在不单击UI的情况下在第一行中触发该操作元素的处理程序。

{
 xtype: 'actioncolumn',
 text: "Delete Me,
 items: [{ 
    iconCls: 'x-fa fa-trash',
    tooltip: "Delete",
    handler: 'deleteGridRec',
  }} 
}

Let colIdx is the index of your action column and grid is the grid contain this column. colIdxaction column的索引,而grid是包含该列的网格。 Then below code to fire the handler of that action element in first row. 然后在下面的代码中触发第一行中该操作元素的处理程序。

deleteGridRec(grid,0,colIdx);

or use 或使用

actionColumn.items[0].handler(grid.up('grid'),0,colIdx);

where actionColumn variable contains action column for row deletion. 其中actionColumn变量包含用于行删除的action column

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM