简体   繁体   English

如何将dropDown HTML嵌入到ag-grid列标题中?

[英]How to embed dropDown HTML inside ag-grid column Headers?

Below is the snapshot of ag-Grid and Kendo grid. 下面是ag-Grid和Kendo网格的快照。

My question is how can I embed a dropdown/html inside the ag-Grid just like I did in kendo. 我的问题是,如何像在剑道中一样将dropdown / html嵌入到ag-Grid中。 I've tried to bind it with headerCellTemplate but it removes the columnName header from the grid and overwrite it with the dropDown html. 我尝试将其与headerCellTemplate绑定,但是它从网格中删除了columnName标头,并使用dropDown html覆盖了它。 I want it exactly same as in the Kendo grid. 我希望它与剑道网格完全相同。

Ag-Grid用户界面

剑道网格用户界面

Use the headerCellRenderer instead of headerCellTemplate attribute and build the following node : 使用headerCellRenderer而不是headerCellTemplate属性,并构建以下节点:

  1. A parent div 父级div
  2. A child span with the headerName, you can get it from the params.colDe.headerName. 带有headerName的子跨度,可以从params.colDe.headerName中获取。
  3. A child select element 子选择元素

For more details check the 2nd example of this link : https://www.ag-grid.com/angular-grid-header-rendering/index.php 有关更多详细信息,请检查此链接的第二个示例: https : //www.ag-grid.com/angular-grid-header-rendering/index.php

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

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