立即在所有单元格上启动单元格编辑器 [英] start cell editor immediately on all cells

查看:34
本文介绍了立即在所有单元格上启动单元格编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找如何仅使用单元格编辑器启动 ag-grid 表格的解决方案.这意味着我不想点击行或单元格来编辑数据.

通过文档中的这个例子,我几乎找到了一个解决方案:整行编辑

这正是我正在寻找的.我可以以编程方式立即开始编辑.该示例的问题在于 onCellValueChanged 仅在键盘单击输入"或单击下一行后才会触发.我需要一个在单元格更改后立即触发 onCellValueChanged 的解决方案.

解决方案

我能想到两个想法来完成这个:

  1. 使用无点击编辑"这类似于让所有单元格都包含一个输入框.只需单击 1 次即可聚焦.https://www.ag-grid.com/javascript-grid-cell-editing/#no-click-editing

  2. 自定义单元格渲染器使用自定义单元格渲染器在每个单元格中有输入框.然后,您始终处于编辑模式.您可以控制何时保存该值.https://www.ag-grid.com/javascript-grid-cell-rendering-components/

I am searching for a solution to how I can start an ag-grid table with only cell editors. That means I do not want to click into the row or cell to edit the data.

I have found almost a solution for me with this example in the doc: Full row editing

This is exactly what I am searching for. I can programmatically start editing immediately. The problem with that example is that onCellValueChanged is only fired after the keyboard click "enter" or click on the next row. I would need a solution where onCellValueChanged is fired immediately after a cell changed.

解决方案

I can think of two ideas to accomplish this:

  1. Use "No Click Editing" This is similar to having all cells contain an input box. It just takes 1 click to focus. https://www.ag-grid.com/javascript-grid-cell-editing/#no-click-editing

  2. Custom cell renderer Use a custom cell renderer to have input boxes in each cell. Then, you are always in edit mode. And you can control when the value is saved. https://www.ag-grid.com/javascript-grid-cell-rendering-components/

这篇关于立即在所有单元格上启动单元格编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆