Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions projects/igniteui-angular/src/lib/grids/common/pipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class IgxGridRowClassesPipe implements PipeTransform {
index: number,
mrl: boolean,
filteredOut: boolean,
_rowData: any,
_: number
) {
const result = new Set(['igx-grid__tr', index % 2 ? row.grid.evenRowCSS : row.grid.oddRowCSS]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@
</ng-container>
<ng-template #record_template let-rowIndex="index" let-rowData let-disabledRow="disabled">
<igx-grid-row [gridID]="id" [index]="rowIndex" [data]="rowData" [disabled]="disabledRow"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:pipeTrigger"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger" #row>
</igx-grid-row>
</ng-template>
<ng-template #pinned_record_template let-rowIndex="index" let-rowData>
<igx-grid-row [gridID]="id" [index]="rowIndex" [data]="rowData"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:pipeTrigger"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger"#row #pinnedRow>
</igx-grid-row>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
</ng-template>
<ng-template #hierarchical_record_template let-rowIndex="index" let-disabledRow="disabled" let-rowData>
<igx-hierarchical-grid-row [gridID]="id" [index]="rowIndex" [disabled]="disabledRow" [data]="rowData"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:pipeTrigger"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger" #row>
</igx-hierarchical-grid-row>
</ng-template>

<ng-template #pinned_hierarchical_record_template let-rowIndex="index" let-rowData>
<igx-hierarchical-grid-row [gridID]="id" [index]="rowIndex" [data]="rowData"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:pipeTrigger"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger" #row #pinnedRow>
</igx-hierarchical-grid-row>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</ng-template>
<ng-template #record_template let-rowIndex="index" let-rowData>
<igx-pivot-row [style.height.px]="renderedRowHeight" [gridID]="id" [index]="rowIndex" [data]="rowData"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:pipeTrigger"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:false:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger" #row>
</igx-pivot-row>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
<ng-container *ngTemplateOutlet="hasPinnedRecords && !isRowPinningToTop ? pinnedRecordsTemplate : null"></ng-container>
<ng-template #record_template let-rowIndex="index" let-disabledRow="disabled" let-rowData>
<igx-tree-grid-row [gridID]="id" [index]="rowIndex" [treeRow]="rowData" [disabled]="disabledRow"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:row.treeRow.isFilteredOutParent:pipeTrigger"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:row.treeRow.isFilteredOutParent:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger" #row>
</igx-tree-grid-row>
</ng-template>
<ng-template #pinned_record_template let-rowIndex="index" let-rowData>
<igx-tree-grid-row [gridID]="id" [index]="rowIndex" [treeRow]="rowData"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:row.treeRow.isFilteredOutParent:pipeTrigger"
[ngClass]="rowClasses | igxGridRowClasses:row:row.inEditMode:row.selected:row.dirty:row.deleted:row.dragging:rowIndex:hasColumnLayouts:row.treeRow.isFilteredOutParent:rowData:pipeTrigger"
[ngStyle]="rowStyles | igxGridRowStyles:rowData:rowIndex:pipeTrigger"#row #pinnedRow>
</igx-tree-grid-row>
</ng-template>
Expand Down
4 changes: 2 additions & 2 deletions src/app/hierarchical-grid/hierarchical-grid.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ <h4 class="sample-title">Sample One</h4>
style="display: block; width: 500px"></igx-buttongroup>
</div>
<button igxButton="raised" (click)="getState()">Get state</button>
<igx-hierarchical-grid [batchEditing]="true" #grid1 [data]="localData" [showExpandAll]="true" [pinning]="{rows: 0}" [hasChildrenKey]='"hasChild"' class="hgrid"
<igx-hierarchical-grid [batchEditing]="true" #grid1 [data]="localData" [showExpandAll]="true" [pinning]="{rows: 0}" class="hgrid"
[displayDensity]="density" [rowSelection]="selectionMode" [autoGenerate]="false" [allowFiltering]="true"
[rowDraggable]="true" [height]="'600px'" [width]="'800px'" [expandChildren]="rootExpanded"
#hGrid>
#hGrid [rowClasses]="rowClasses">

<igx-grid-toolbar>
<app-grid-search-box [grid]="grid1"></app-grid-search-box>
Expand Down
5 changes: 5 additions & 0 deletions src/app/hierarchical-grid/hierarchical-grid.sample.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:host::ng-deep {
.activeRow {
background-color: rgb(201, 241, 201);
}
}
7 changes: 6 additions & 1 deletion src/app/hierarchical-grid/hierarchical-grid.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

@Component({
selector: 'app-hierarchical-grid-sample',
styleUrls: ['hierarchical-grid.sample.css'],
styleUrls: ['hierarchical-grid.sample.scss'],
templateUrl: 'hierarchical-grid.sample.html'
})
export class HierarchicalGridSampleComponent implements AfterViewInit {
Expand All @@ -34,6 +34,11 @@ export class HierarchicalGridSampleComponent implements AfterViewInit {
public columns;
public childColumns;

public evenCondition = (row: RowType) => parseInt(row.data['ID'], 0) % 2 === 0;
public rowClasses = {
activeRow: this.evenCondition,
};

constructor(private cdr: ChangeDetectorRef) {
this.displayDensities = [
{ label: 'compact', selected: this.density === 'compact', togglable: true },
Expand Down