angular-ui/ui-grid

suggestion: grouping: select all lines in a group at once

Open

#4.122 geöffnet am 5. Aug. 2015

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.496 Forks)batch import
help wantedtype: enhancement

Repository-Metriken

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

Beschreibung

It would be great if the code in the example 320 complex grouping was integrated as a feature. I think it is a natural option to be used by the user.

$scope.gridApi.selection.on.rowSelectionChanged( $scope, function ( rowChanged ) {
    if ( typeof(rowChanged.treeLevel) !== 'undefined' && rowChanged.treeLevel > -1 ) {
      // this is a group header
      children = $scope.gridApi.treeBase.getRowChildren( rowChanged );
      children.forEach( function ( child ) {
        if ( rowChanged.isSelected ) {
          $scope.gridApi.selection.selectRow( child.entity );
        } else {
          $scope.gridApi.selection.unSelectRow( child.entity );
        }
      });
    }
  });

Thanks

Contributor Guide