|
29 | 29 | <ng-container *ngIf="grid.hasColumnLayouts"> |
30 | 30 | <ng-container *ngIf="pinnedColumns.length > 0"> |
31 | 31 | <div *ngFor="let col of pinnedColumns | igxTopLevel" class="igx-grid__mrl-block" |
32 | | - [ngClass]="{'igx-grid__td--pinned-last': col.hasLastPinnedChildColumn}" |
33 | | - [ngStyle]="{'grid-template-rows':col.getGridTemplate(true, false), |
34 | | - 'grid-template-columns':col.getGridTemplate(false, false), |
35 | | - 'z-index': col.pinned ? 1 : null, |
36 | | - '-ms-grid-rows':col.getGridTemplate(true, true), |
37 | | - '-ms-grid-columns':col.getGridTemplate(false, true)}"> |
38 | | - <ng-template ngFor let-col [ngForOf]="col.children"> |
39 | | - <ng-container *ngTemplateOutlet="col.visibleIndex === 0 && grid.hasDetails? expandableCellTemplate : cellTemplate; context: getContext(col, this)"></ng-container> |
40 | | - </ng-template> |
| 32 | + [class.igx-grid__td--pinned-last]="col.hasLastPinnedChildColumn" |
| 33 | + [ngStyle]="{ |
| 34 | + 'grid-template-rows':col.getGridTemplate(true, false), |
| 35 | + 'grid-template-columns':col.getGridTemplate(false, false), |
| 36 | + 'z-index': col.pinned ? 1 : null, |
| 37 | + '-ms-grid-rows':col.getGridTemplate(true, true), |
| 38 | + '-ms-grid-columns':col.getGridTemplate(false, true) |
| 39 | + }"> |
| 40 | + <ng-template ngFor let-col [ngForOf]="col.children"> |
| 41 | + <ng-container *ngTemplateOutlet="col.visibleIndex === 0 && grid.hasDetails? mrlExpandableCellTemplate : mrlCellTemplate; context: getContext(col, this)"></ng-container> |
| 42 | + </ng-template> |
41 | 43 | </div> |
42 | 44 | </ng-container> |
43 | 45 | <ng-template igxGridFor let-col [igxGridForOf]="unpinnedColumns | igxTopLevel" [igxForScrollContainer]="grid.parentVirtDir" let-colIndex="index" [igxForScrollOrientation]="'horizontal'" [igxForContainerSize]='grid.unpinnedWidth' [igxForSizePropName]='"calcPixelWidth"' [igxForTrackBy]='grid.trackColumnChanges' #igxDirRef> |
44 | | - <div class="igx-grid__mrl-block" |
45 | | - [ngStyle]="{'grid-template-rows':col.getGridTemplate(true, false), |
46 | | - 'grid-template-columns':col.getGridTemplate(false, false), |
47 | | - '-ms-grid-rows':col.getGridTemplate(true, true), |
48 | | - '-ms-grid-columns':col.getGridTemplate(false, true)}"> |
| 46 | + <div class="igx-grid__mrl-block" [ngStyle]="{ |
| 47 | + 'grid-template-rows':col.getGridTemplate(true, false), |
| 48 | + 'grid-template-columns':col.getGridTemplate(false, false), |
| 49 | + '-ms-grid-rows':col.getGridTemplate(true, true), |
| 50 | + '-ms-grid-columns':col.getGridTemplate(false, true) |
| 51 | + }"> |
49 | 52 | <ng-template ngFor let-col [ngForOf]="col.children"> |
50 | | - <ng-container *ngTemplateOutlet="col.visibleIndex === 0 && grid.hasDetails ? expandableCellTemplate : cellTemplate; context: getContext(col, this)"></ng-container> |
| 53 | + <ng-container *ngTemplateOutlet="col.visibleIndex === 0 && grid.hasDetails ? mrlExpandableCellTemplate : mrlCellTemplate; context: getContext(col, this)"></ng-container> |
51 | 54 | </ng-template> |
52 | 55 | </div> |
53 | 56 | </ng-template> |
|
80 | 83 | [lastPinned]="col.columnLayoutChild ? null : col.isLastPinned" |
81 | 84 | [style.min-height.px]="grid.rowHeight || 32" |
82 | 85 | [rowData]="rowData" |
83 | | - [style.min-width]="col.columnLayoutChild ? null : col.width" |
84 | | - [style.max-width]="col.parent ? null : col.width" |
85 | | - [style.flex-basis]="col.parent ? null : col.width" |
86 | | - [width]="col.parent ? null : col.getCellWidth()" |
| 86 | + [style.min-width]="col.width" |
| 87 | + [style.max-width]="col.width" |
| 88 | + [style.flex-basis]="col.width" |
| 89 | + [width]="col.getCellWidth()" |
87 | 90 | [visibleColumnIndex]="col.visibleIndex" |
88 | 91 | [value]="rowData[col.field]" |
89 | 92 | [cellTemplate]="col.bodyTemplate" |
|
106 | 109 | [lastPinned]="col.columnLayoutChild ? null : col.isLastPinned" |
107 | 110 | [style.min-height.px]="grid.rowHeight || 32" |
108 | 111 | [rowData]="rowData" |
109 | | - [style.min-width]="col.columnLayoutChild ? null : col.width" |
110 | | - [style.max-width]="col.columnLayoutChild ? null : col.width" |
111 | | - [style.flex-basis]="col.columnLayoutChild ? null : col.width" |
112 | | - [width]="col.columnLayoutChild ? null : col.getCellWidth()" |
| 112 | + [style.min-width]="col.width" |
| 113 | + [style.max-width]="col.width" |
| 114 | + [style.flex-basis]="col.width" |
| 115 | + [width]="col.getCellWidth()" |
113 | 116 | [visibleColumnIndex]="col.visibleIndex" |
114 | 117 | [value]="rowData[col.field]" |
115 | 118 | [cellTemplate]="col.bodyTemplate" |
116 | 119 | [cellSelectionMode]="grid.cellSelection" #cell> |
117 | 120 | </igx-expandable-grid-cell> |
118 | 121 | </ng-template> |
119 | 122 |
|
| 123 | +<ng-template #mrlCellTemplate let-col> |
| 124 | + <igx-grid-cell |
| 125 | + class="igx-grid__td igx-grid__td--fw" |
| 126 | + [class.igx-grid__td--pinned]="col.pinned" |
| 127 | + [class.igx-grid__td--number]="col.dataType === 'number'" |
| 128 | + [ngClass]="col.cellClasses | igxCellStyleClasses:rowData[col.field]:rowData:col.field:viewIndex" |
| 129 | + [ngStyle]="col.cellStyles | igxCellStyles:rowData[col.field]:rowData:col.field:viewIndex" |
| 130 | + [editMode]="col.editable && crudService.isInEditMode(index, col.index)" |
| 131 | + [column]="col" |
| 132 | + [style.-ms-grid-row-span]="col.gridRowSpan" |
| 133 | + [style.-ms-grid-column-span]="col.girdColumnSpan" |
| 134 | + [style.grid-row-end]="col.rowEnd" |
| 135 | + [style.grid-column-end]="col.colEnd" |
| 136 | + [style.-ms-grid-row]="col.rowStart" |
| 137 | + [style.grid-row-start]="col.rowStart" |
| 138 | + [style.-ms-grid-column]="col.colStart" |
| 139 | + [style.grid-column-start]="col.colStart" |
| 140 | + [lastPinned]="col.columnLayoutChild ? null : col.isLastPinned" |
| 141 | + [formatter]="col.formatter" |
| 142 | + [row]="this" |
| 143 | + [style.min-height.px]="grid.rowHeight || 32" |
| 144 | + [rowData]="rowData" |
| 145 | + [visibleColumnIndex]="col.visibleIndex" |
| 146 | + [value]="rowData[col.field]" |
| 147 | + [cellTemplate]="col.bodyTemplate" |
| 148 | + [cellSelectionMode]="grid.cellSelection" #cell> |
| 149 | + </igx-grid-cell> |
| 150 | +</ng-template> |
120 | 151 |
|
| 152 | +<ng-template #mrlExpandableCellTemplate let-col> |
| 153 | + <igx-expandable-grid-cell |
| 154 | + class="igx-grid__td igx-grid__td--fw igx-grid__td--tree-cell" |
| 155 | + [class.igx-grid__td--pinned]="col.pinned" |
| 156 | + [class.igx-grid__td--number]="col.dataType === 'number' && col.visibleIndex !== 0" |
| 157 | + [ngClass]="col.cellClasses | igxCellStyleClasses:rowData[col.field]:rowData:col.field:viewIndex" |
| 158 | + [ngStyle]="col.cellStyles | igxCellStyles:rowData[col.field]:rowData:col.field:viewIndex" |
| 159 | + [expanded]="expanded" |
| 160 | + [editMode]="col.editable && crudService.isInEditMode(index, col.index)" |
| 161 | + [column]="col" |
| 162 | + [style.-ms-grid-row-span]="col.gridRowSpan" |
| 163 | + [style.-ms-grid-column-span]="col.girdColumnSpan" |
| 164 | + [style.grid-row-end]="col.rowEnd" |
| 165 | + [style.grid-column-end]="col.colEnd" |
| 166 | + [style.-ms-grid-row]="col.rowStart" |
| 167 | + [style.grid-row-start]="col.rowStart" |
| 168 | + [style.-ms-grid-column]="col.colStart" |
| 169 | + [style.grid-column-start]="col.colStart" |
| 170 | + [lastPinned]="col.columnLayoutChild ? null : col.isLastPinned" |
| 171 | + [formatter]="col.formatter" |
| 172 | + [row]="this" |
| 173 | + [style.min-height.px]="grid.rowHeight || 32" |
| 174 | + [rowData]="rowData" |
| 175 | + [visibleColumnIndex]="col.visibleIndex" |
| 176 | + [value]="rowData[col.field]" |
| 177 | + [cellTemplate]="col.bodyTemplate" |
| 178 | + [cellSelectionMode]="grid.cellSelection" #cell> |
| 179 | + </igx-expandable-grid-cell> |
| 180 | +</ng-template> |
0 commit comments