angular-ui/ui-grid

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

クローズ

#4,122 opened on 2015/08/05

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (2,496 件のフォーク)batch import
help wantedtype: enhancement

Repository metrics

Stars
 (5,395 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド