angular-ui/ui-grid

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

Fechada

#4.122 aberto em 5 de ago. de 2015

 (1 comentário) (0 reação) (0 responsável)JavaScript (2.496 forks)batch import
help wantedtype: enhancement

Métricas do repositório

Stars
 (5.395 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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

Guia do colaborador