如何在 ui-grid 中使用刷新方法? [英] How to use refresh method in ui-grid?
本文介绍了如何在 ui-grid 中使用刷新方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试更新我的 ui-grid 的 columDefs 中的可见性选项.更新值后,我需要刷新我的 ui-grid.从控制器刷新网格的方法是什么?
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?
推荐答案
访问此页面:
- GetAPI - http://ui-grid.info/docs/#/api/ui.grid.class:GridApi
- 特定 API - http://ui-grid.info/docs/#/api/ui.grid.core.api:PublicApi
http://ui-grid.info/docs/#/api/ui.grid.class:GridApi
在实例化您的 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();
希望有帮助!
这篇关于如何在 ui-grid 中使用刷新方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文