Column filter lost when updating row data in ag-grid

穿精又带淫゛_ 提交于 2020-01-01 05:17:10

问题


I am trying to pre-configure a column filter in ag-grid, a simple text "equals" filter to show only rows matching some specified text, I have got this working.

However as soon as I replace the model data with a fresh set of rows, my filter disappears.

I have tried updating my model data in 2 ways:

  • by replacing the value of the bound rowData property (I'm using Vue.js)
  • calling api.setRowData(newRows)

Both of these cause the column filter to be lost.

Is there a way to update the model data without losing column filters?


回答1:


In their documentation it says that you can set the gridOptions property deltaRowDataMode=true, then use the api.setRowData(newRows). This will compare the current row data to the new data to see what has changed and update accordingly. Without this property set, the grid rips out all settings to ensure a fresh start.



来源:https://stackoverflow.com/questions/45079166/column-filter-lost-when-updating-row-data-in-ag-grid

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