angular-ui/ui-grid

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

已關閉

#4,122 建立於 2015年8月5日

 (1 則留言) (0 個反應) (0 位負責人)JavaScript (2,496 個分叉)batch import
help wantedtype: enhancement

倉庫指標

星標
 (5,395 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南