【发布时间】:2020-08-30 19:32:09
【问题描述】:
我为ag-Grid 制作了一些自定义导航组件。
一旦用户采取行动,我想关注ag-Grid 的行或单元格之一,就好像用户自己只是单击了ag-Grid 的单元格之一一样。
所以在这个聚焦之后,下次我按下像Up/Down/Left/Right这样的键时,它被注册为ag-Grid的键盘交互事件(Keyboard Interaction: Core Feature of our Datagrid) .
更具体地说,一旦按下箭头键,navigateToNextCell() 挂钩就会被调用。
我该怎么做?
我在以下方面进行了实验:
gridApi.setFocusedCell(0, 0)gridApi.dispatchEvent({ type: 'cellFocused', rowIndex, column })document.querySelector('.ag-root-wrapper').focus()
这些都不起作用。
【问题讨论】:
标签: ag-grid ag-grid-react