有什么方法可以对 ag-grid 中的网格中的所有列和行进行搜索吗? [英] Is there any way to run a search against all columns and rows in the grid in ag-grid?
问题描述
我的标题几乎说明了一切.我想对 ag-grid 中的每一列和每一行运行全文搜索(仅包含或喜欢搜索).这可能吗?这是内置在数据表中的.
My title pretty much says it all. I want to run a full text search (simply contains or like search) against every column and row in an ag-grid. Is this possible? This is built into datatables.
推荐答案
Ag-grid Doc - https://www.ag-grid.com/javascript-grid-filter-quick/#quick-filter-example
Ag-grid Doc - https://www.ag-grid.com/javascript-grid-filter-quick/#quick-filter-example
Plunker - https://plnkr.co/edit/NaDAQYvXoo2P6vxdvPVB?p=preview一个>
添加一个带有 onFilterTextBoxChanged() 函数的文本框
Add a text box with function onFilterTextBoxChanged()
<input type="text" id="filter-text-box" placeholder="Filter..." oninput="onFilterTextBoxChanged()"/>
使用用户在此文本框中输入的值为 Ag-grid 设置快速过滤器
setQuickFilter for Ag-grid with the value entered by the user in this text box
function onFilterTextBoxChanged() {
gridOptions.api.setQuickFilter(document.getElementById('filter-text-box').value);
}
这篇关于有什么方法可以对 ag-grid 中的网格中的所有列和行进行搜索吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!