File tree Expand file tree Collapse file tree 4 files changed +28
-4
lines changed
projects/igniteui-angular/src/lib/grids
src/app/grid-column-selection Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
233233 * @memberof IgxColumnGroupComponent
234234 */
235235 get selected ( ) : boolean {
236- const selectableChildren = this . children . filter ( c => c . selectable && ! c . hidden ) ;
236+ const selectableChildren = this . allChildren . filter ( c => ! c . columnGroup && c . selectable && ! c . hidden ) ;
237237 return selectableChildren . length > 0 && selectableChildren . every ( c => c . selected ) ;
238238 }
239239
Original file line number Diff line number Diff line change @@ -240,8 +240,8 @@ export class IgxGridHeaderGroupComponent implements DoCheck {
240240 * @hidden
241241 */
242242 public groupClicked ( event ) : void {
243- if ( this . column . selectable && ! this . grid . filteringService . isFilterRowVisible ) {
244- const columnsToSelect = this . getSelectableChildren ( this . column . children . toArray ( ) ) . map ( c => c . field ) ;
243+ const columnsToSelect = this . getSelectableChildren ( this . column . children . toArray ( ) ) . map ( c => c . field ) ;
244+ if ( columnsToSelect . length > 0 && ! this . grid . filteringService . isFilterRowVisible ) {
245245 if ( ! this . selected ) {
246246 this . grid . selectionService . selectColumns ( columnsToSelect , ! event . ctrlKey , event ) ;
247247 } else {
Original file line number Diff line number Diff line change 5959 < button igxButton ="raised " (click) ="deselectCol() "> Deselect ID</ button >
6060 < button igxButton ="raised " (click) ="grid1.deselectAllColumns() "> Deselect all columns</ button >
6161 </ div >
62+
63+ < igx-grid #grid [data] ="data " height ="500px " width ="1000px " columnWidth ="100px ">
64+ < igx-column-group header ="General Information " >
65+ < igx-column field ="CompanyName " > </ igx-column >
66+ < igx-column-group header ="Person Details ">
67+ < igx-column field ="ContactName " [selectable] ="false "> </ igx-column >
68+ < igx-column field ="ContactTitle " [hidden] ="true "> </ igx-column >
69+ </ igx-column-group >
70+ </ igx-column-group >
71+ < igx-column field ="ID "> </ igx-column >
72+ < igx-column-group header ="Country Information ">
73+
74+ < igx-column-group header ="Region Information ">
75+ < igx-column field ="Country " [selectable] ="false "> </ igx-column >
76+ < igx-column field ="Region " > </ igx-column >
77+ < igx-column field ="PostalCode " > </ igx-column >
78+ </ igx-column-group >
79+ < igx-column-group header ="City Information " >
80+ < igx-column field ="City " [selectable] ="false " > </ igx-column >
81+ < igx-column field ="Address " [selectable] ="false "> </ igx-column >
82+ </ igx-column-group >
83+ </ igx-column-group >
84+ </ igx-grid >
6285 </ div >
6386 </ div >
6487</ div >
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { SAMPLE_DATA } from '../shared/sample-data';
2424export class GridColumnSelectionSampleComponent implements OnInit {
2525 public searchSelectedColumn = '' ;
2626 public data : Array < any > ;
27+ public groupsData = [ ] ;
2728 public columns : Array < any > ;
2829 public filterModes = [
2930 {
@@ -53,7 +54,7 @@ export class GridColumnSelectionSampleComponent implements OnInit {
5354 } ;
5455
5556 @ViewChild ( 'grid1' , { static : true } ) public grid1 : IgxGridComponent ;
56-
57+ @ ViewChild ( 'grid' , { static : true } ) public grid : IgxGridComponent ;
5758 @ViewChild ( 'columnSelectionDropdown' , { read : IgxDropDownComponent } )
5859 public columnSelectionDropdown : IgxDropDownComponent ;
5960
You can’t perform that action at this time.
0 commit comments