How to use refresh method in ui-grid?

前端 未结 3 1763
逝去的感伤
逝去的感伤 2020-12-15 04:16

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 con

相关标签:
3条回答
  • 2020-12-15 04:29

    You can use $scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.COLUMN); method after you modify the column defs and then refesh the grid .

    More Details on http://ui-grid.info/docs/#!/api/ui.grid.service:uiGridConstants#properties_datachange

    0 讨论(0)
  • 2020-12-15 04:33

    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!

    0 讨论(0)
  • 2020-12-15 04:33

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

    enableRowHashing:false

    0 讨论(0)
提交回复
热议问题