Skip to content

Commit

Permalink
angular-ui#6033: This is a proposed fix for the issue where the "sele…
Browse files Browse the repository at this point in the history
…ctAll" header 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 vishalnarewade committed Nov 6, 2017
1 parent a0f7026 commit d2a5258
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 d2a5258

Please sign in to comment.