Force datasource to reload data in Angular 2 grid

北城以北 提交于 2019-12-11 06:18:05

问题


I am using Angular 2 and have a grid (ag-grid-angular) with enableServerSideSorting=true and it's working fine only for the first time: the data is loaded and placed in the grid view as expected. When I click on a column to sort that column (which happens automatically) the data is fetched again by calling getRows(params).

The problem is that I have several other input fields:

  • Tabs: to change the type of elements displayed (for example persons or cars).
  • Text field: which is used to enter search criteria.

When I change these input fields, how can I force datasource to collect data again from the server? If I change the tab or search field, then the correct data is only fetched again after I press on one of the columns (forcing to sort again).

I tried this.agGrid.api.refreshView() in the method that is triggered by changing the tab, but this ofcourse does not work.

来源:https://stackoverflow.com/questions/44590937/force-datasource-to-reload-data-in-angular-2-grid

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