如何在ui-grid中使用刷新方法?

问题描述 投票:26回答:2

我正在尝试更新我的ui-grid的columDefs中的可见性选项。更新值后,我需要刷新我的ui-grid。从我的控制器刷新网格的方法是什么?

javascript angularjs angular-ui-grid
2个回答
37
投票

访问此页面:

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

在实例化gridApi之后,您可以调用:

//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();

希望有所帮助!


8
投票

根据您的需要,您可以更改以下ui-grid选项

enableRowHashing:false

© www.soinside.com 2019 - 2024. All rights reserved.