angular-ui/ui-grid

Invalid arguments provided in click handler of selectionSelectAllButtons & treeBaseExpandAllButtons

Open

#4.551 geöffnet am 20. Okt. 2015

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (1 zugewiesene Person)JavaScript (2.496 Forks)batch import
good first issuegrid-selection

Repository-Metriken

Stars
 (5.395 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Hi,

there is a bug in the ui-grid/selectionSelectAllButtons template or its directive: the click handler in directive uiGridSelectionSelectAllButtons is expecting 2 arguments:

$scope.headerButtonClick = function(row, evt) { }

but only the $event argument is provided, resulting in a wrongly assigned argument (i.e. event is passed as the row argument). You should either fix the template or modify the directive. The same goes for the uiGridTreeBaseExpandAllButtons directive btw.

NB I suggest you modify the templates to

ng-click="headerButtonClick(null, $event)"

because then you keep your code in line with the other templates (e.g. selectionRowHeaderButtons.html)

Contributor Guide