简体   繁体   English

日历作为农业网格单元中的弹出窗口

[英]calendar as a popup in ag-grid cell

I am using ag-grid to display a list of columns. 我正在使用ag-grid显示列列表。 One of the columns contains the date section. 列之一包含日期部分。

User should be able to edit the row and use calendar to select a particular date. 用户应该能够编辑行并使用日历选择特定日期。 Once a date is selected, it will get updated in the cell. 选择日期后,该日期将在单元格中更新。

Any idea how to make it achievable ? 知道如何实现它吗?

As per Ag-grid, we have to use cellEditor rather than cellRenderer to edit a cell and show calendar at every cell for selection of a date 根据Ag-grid,我们必须使用cellEditor而不是cellRenderer来编辑单元格并在每个单元格上显示日历以选择日期

https://www.ag-grid.com/javascript-grid-cell-editing/index.php They have given few examples of how we can use Celleditor. https://www.ag-grid.com/javascript-grid-cell-editing/index.php他们给出了一些如何使用Celleditor的示例。 Can someone please let me know how to use calendar for each cells of the 'date' column. 有人可以让我知道如何在“日期”列的每个单元格中使用日历。

Got the following answer from ag-grid team 从农业电网团队得到以下答案

editing of dates is not provided out of the box. 未提供开箱即用的日期编辑功能。 you will need to create your own cell editor for dates. 您将需要为日期创建自己的单元格编辑器。

details on how to do cell editors is here: https://www.ag-grid.com/javascript-grid-.../index.php 有关如何执行单元格编辑器的详细信息,请参见: https : //www.ag-grid.com/javascript-grid-.../index.php

I use bootstrap, and this has property type="date". 我使用引导程序,并且它具有属性type =“ date”。 I have one list "ListDataSource", this has one file call celDate and contains this html: When i send this list to api.setRowData(ListDataSource), the grid create the date input. 我有一个列表“ ListDataSource”,它有一个文件调用celDate并包含以下html:当我将此列表发送到api.setRowData(ListDataSource)时,网格将创建日期输入。

See you. 再见。

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

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