Skip to content

Commit

Permalink
#6033: This is a proposed fix for the issue where the "selectAll" hea…
Browse files Browse the repository at this point in the history
…der check is not in sync with the actual selection state of the row. Perhaps this is not the best solution because it couples the selection directive the ui-grid directive. However, this does illustrate a possible solution.
  • Loading branch information
Walter Holladay authored and mportuga committed Aug 11, 2017
1 parent 219ea71 commit aae3f9d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/js/core/factories/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ angular.module('ui.grid')
var self = this;
var oldRows = self.rows.slice(0);
var oldRowHash = self.rowHashMap || self.createRowHashMap();
var allRowsSelected = true;
self.rowHashMap = self.createRowHashMap();
self.rows.length = 0;

Expand Down Expand Up @@ -1163,8 +1164,15 @@ angular.module('ui.grid')

self.rows.push( newRow );
self.rowHashMap.put( newEntity, newRow );
if (!newRow.isSelected) {
allRowsSelected = false;
}
});

if (self.selection) {
self.selection.selectAll = allRowsSelected;
}

self.assignTypes();

var p1 = $q.when(self.processRowsProcessors(self.rows))
Expand Down

0 comments on commit aae3f9d

Please sign in to comment.