angular-ui/ui-grid

if rowIdentity is overriden, data changes are not detected properly

Open

#4374 aperta il 15 set 2015

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (2496 fork)batch import
help wantedneeds: analysis

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor