angular-ui/ui-grid

if rowIdentity is overriden, data changes are not detected properly

Open

#4 374 ouverte le 15 sept. 2015

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)JavaScript (2 496 forks)batch import
help wantedneeds: analysis

Métriques du dépôt

Stars
 (5 395 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Hi.

I encounter some difficulty with ui-grid 3.0.6, I'm new to it, so I did a lot of copy/paste, and I did copy a code chunk where rowIdentity is overriden.

From here: http://ui-grid.info/docs/#/tutorial/401_AllFeatures

When it's the case, and when I try to update a Row after a cellEdition, the new data are not being displayed event if you try some refresh(), refreshRows() or notifyDataChanges

in my init I have this

$scope.gridApi.edit.on.afterCellEdit($scope, $scope.saveARow) 

And in my saveARow function I did something like this :

$scope.gridOptions.data[rowIndex] = newRow;

If rowIdentity is overriden, data are not diplayed See. http://plnkr.co/edit/tVRnVxcOfgO8xEHRWj00?p=preview

You'll have to edit a cell put whatever in it, it 'simulate' a call to a save server side, then replace te savedRow by what is present serverside after 3 seconds.

If you comment le rowIdentity override line 28 it will works

Guide contributeur