简体   繁体   English

打开事件之前的 ag-grid 单元格编辑器

[英]ag-grid cell editor before open event

i have a situation where i have a grid with rows.我有一种情况,我有一个带行的网格。 on a cell double click, cell editor is opened.双击单元格,打开单元格编辑器。 there are events arround celleditor cellEditingStarted and cellEditingStarted where you can do something if needed. celleditor cellEditingStarted 和 cellEditingStarted 周围有事件,您可以在需要时执行某些操作。 i need an event which is just before the celleditor opened.我需要一个就在 celleditor 打开之前的事件。

a user double clicked the cell, need to do some thing there and the cell editor pops out after that.用户双击单元格,需要在那里做一些事情,然后弹出单元格编辑器。

is there something like that?有类似的东西吗? cant find in documentation.在文档中找不到。

what i want to do is: custom cell editor pops out of the grid, and when the grid is near the bottom of screen, the cell editor is only half visible, and i made a trick, put a div under the grid and on adding a row, that div enlarges its height so it works fine, but cant make it work when you double click that cell, it doesn't scroll properly我想做的是:自定义单元格编辑器从网格中弹出,当网格靠近屏幕底部时,单元格编辑器只有一半可见,我做了一个把戏,在网格下放一个 div 并添加一行,那个 div 扩大了它的高度所以它工作正常,但是当你双击那个单元格时不能让它工作,它不能正确滚动

在此处输入图像描述 thanks谢谢

You can use the agInit lifecycle method inside the Custom Cell Editor to handle this use case as it is fired before cellEditingStarted :您可以在自定义单元格编辑器中使用agInit生命周期方法来处理此用例,因为它在cellEditingStarted之前触发:

export class MoodEditor implements ICellEditorAngularComp {

  agInit(params: any): void {
    console.log('agInit, handle logic here');
  }

// ...

You can verify this in the following plunkr , open the developer console to see the console log statements.你可以在下面的plunkr中验证这一点,打开开发者控制台查看控制台日志语句。

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

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