Is there any way to run a search against all columns and rows in the grid in ag-grid?

自闭症网瘾萝莉.ら 提交于 2021-01-05 23:54:32

问题


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.


回答1:


Yes, It is possible. Please refer to https://www.ag-grid.com/javascript-grid-filter-quick/

<input type="text" id="filter-text-box" placeholder="Filter..." oninput="onFilterTextBoxChanged()"/>
function onFilterTextBoxChanged() {
    gridOptions.api.setQuickFilter(document.getElementById('filter-text-box').value);
}



回答2:


Ag-grid Doc - https://www.ag-grid.com/javascript-grid-filter-quick/#quick-filter-example

Plunker - https://plnkr.co/edit/NaDAQYvXoo2P6vxdvPVB?p=preview

Add a text box with function onFilterTextBoxChanged()

<input type="text" id="filter-text-box" placeholder="Filter..." oninput="onFilterTextBoxChanged()"/>

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);
}



回答3:


Not natively, but you can implement you own external Filter

Check section External Filtering here https://www.ag-grid.com/angular-grid-filtering/index.php.



来源:https://stackoverflow.com/questions/35854791/is-there-any-way-to-run-a-search-against-all-columns-and-rows-in-the-grid-in-ag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!