Angular ngGrid select row on page load

后端 未结 4 730
轻奢々
轻奢々 2021-01-02 01:01

My question is an extension to thisquestion

Getting select rows from ng-grid?

plunker - http://plnkr.co/edit/DiDitL?p=preview

I need a row to be sele

4条回答
  •  别那么骄傲
    2021-01-02 01:33

    A solution without timeout can be found here: https://github.com/angular-ui/ui-grid/issues/2267 and here: Pre-Select rows on load with angular-ui-grid

    $scope.gridOptions = {
    ...
                    onRegisterApi : function (gridApi) {
                        $scope.gridApi = gridApi;
                        $scope.gridApi.grid.modifyRows($scope.gridOptions.data);
                        $scope.gridApi.selection.selectRow($scope.gridOptions.data[0]);
                    }
                };
    

    Apparently modifyRows requires v3.0.0-rc.22+

提交回复
热议问题