简体   繁体   English

如何在搜索列名时水平滚动 ag-grid

[英]How to scroll ag-grid horizontally on search of column name

I am using ag-grid-angular.我正在使用 ag-grid-angular。 I have one autocomplete/search box, If I enter any characters in search box I need to match those characters with grid's column name and need to highlight/show column as selected.我有一个自动完成/搜索框,如果我在搜索框中输入任何字符,我需要将这些字符与网格的列名匹配,并且需要突出显示/显示选定的列。 if that column is not visible on the viewport because of large grid and columns then I need to scroll the grid horizontally till that column.如果由于网格和列大而在视口上看不到该列,那么我需要水平滚动网格直到该列。

I am using angular 11 and ag-grid.我正在使用 angular 11 和 ag-grid。 I tried it with gridApi but there no such a horizontal scroll functionality available in ag-grid.我用 gridApi 试过,但在 ag-grid 中没有这样的水平滚动功能。

To achieve this you should use the ensureColumnVisible method in the GridAPI.为此,您应该使用 GridAPI 中的ensureColumnVisible方法。

See more info here: https://www.ag-grid.com/javascript-data-grid/grid-api/#reference-scrolling-ensureColumnVisible在此处查看更多信息: https://www.ag-grid.com/javascript-data-grid/grid-api/#reference-scrolling-ensureColumnVisible

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

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