Erik Z
Erik Z

Reputation: 4770

How to update data in the Angular UI Grid?

I'm trying to use the Angular UI Grid. In my HTML I have the following code.

    <div ui-grid="gridOptions"></div>

And in my controller I have the following javascript.

    $scope.values = [{ id: 0, namn: 'erik' }];

    $scope.gridOptions = {
                data: $scope.values
    }

When starting my page the data is displayed in the grid. The problem is when I try to update the data. The changes is not propragated to the grid. The follwing will not update the grid. Why?

$scope.values = [{ id: 100, namn: 'Test' }];

Upvotes: 0

Views: 1349

Answers (1)

hic1086
hic1086

Reputation: 755

it's rather somthing like this :

$scope.gridOptions = {
                data: 'values'
    }

Upvotes: 2

Related Questions