How to use refresh method in ui-grid?

余生颓废 提交于 2019-11-27 14:25:47

问题


I am trying to update visibility option in the columDefs of my ui-grid. After updating the value I need to refresh my ui-grid. What is the way to refresh my grid from my controller?


回答1:


Visit this pages:

  • GetAPI - http://ui-grid.info/docs/#/api/ui.grid.class:GridApi
  • Specific API - http://ui-grid.info/docs/#/api/ui.grid.core.api:PublicApi

http://ui-grid.info/docs/#/api/ui.grid.class:GridApi

After having instantiated your gridApi, you can just call:

//instantiate (not so obvious)
// whatever scope attribute your binding to gridOptions
$scope.gridOptions = {
  onRegisterApi: function(gridApi){ $scope.gridApi = gridApi;}
}
//then later
$scope.gridApi.core.refresh();

Hope that helps!




回答2:


Depending on your need you can change the following ui-grid option

enableRowHashing:false



来源:https://stackoverflow.com/questions/26634063/how-to-use-refresh-method-in-ui-grid

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