Skip to content

Commit d46d04c

Browse files
committed
fix: flushDirtyRows will not throw an error when no dirty rows
1 parent d9c50cf commit d46d04c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: src/features/row-edit/js/gridRowEdit.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@
393393
*/
394394
flushDirtyRows: function(grid){
395395
var promises = [];
396-
grid.rowEdit.dirtyRows.forEach( function( gridRow ){
396+
grid.api.rowEdit.getDirtyRows().forEach( function( gridRow ){
397397
service.saveRow( grid, gridRow )();
398398
promises.push( gridRow.rowEditSavePromise );
399399
});

Diff for: src/features/row-edit/test/uiGridRowEditService.spec.js

+6
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,12 @@ describe('ui.grid.edit uiGridRowEditService', function () {
530530
expect( success ).toEqual(false);
531531
expect( failure ).toEqual(true);
532532
});
533+
534+
it( 'no dirty rows, no error is thrown', function() {
535+
expect(function() {
536+
uiGridRowEditService.flushDirtyRows( grid );
537+
}).not.toThrow();
538+
});
533539
});
534540

535541

0 commit comments

Comments
 (0)