-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid - conditional cell styling #2588
Changes from all commits
972148c
6fea567
05bf88c
e9521ac
bbc1f60
c48ba0e
7bd0324
989119e
b91bb68
e9f7757
f6baa02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:host::ng-deep { | ||
.test2 { | ||
color: black !important; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, when a cell fits two or more conditions, we may want to define which would take precedence...not of great importance, but a possible use case. |
||
font-weight: bold; | ||
background-color: greenyellow !important; | ||
} | ||
.test { | ||
color: red; | ||
font-weight: bold; | ||
background-color: yellow; | ||
} | ||
.test1 { | ||
color: blue ; | ||
font-weight: bold; | ||
background-color: salmon; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<div class="wrapper"> | ||
<app-page-header title="Grid Conditional Cell Styling"> | ||
Allows condional cell styling. | ||
</app-page-header> | ||
|
||
<div class="sample-content"> | ||
<div class="sample-column"> | ||
<igx-grid #grid1 [data]="data" [primaryKey]="'ID'" [width]="'900px'" [height]="'500px'" [rowSelectable]="true"> | ||
<igx-column *ngFor="let c of columns" [field]="c.field" | ||
[header]="c.field" | ||
[width]="c.width" | ||
[movable]="true" | ||
[groupable]="true" | ||
[resizable]="true" | ||
[sortable]="true" | ||
[filterable]="true" | ||
[editable]="true" | ||
[cellClasses]="c.cellClasses"> | ||
</igx-column> | ||
</igx-grid> | ||
<div class="sample-buttons"> | ||
<button igxButton="raised" (click)="toggleColumn('ContactName')">Pin/Unpin 'ContactName'</button> | ||
<button igxButton="raised" (click)="toggleColumn('ContactTitle')">Pin/Unpin 'ContactTitle'</button> | ||
<button igxButton="raised" (click)="toggleColumn('Address')">Pin/Unpin 'Address'</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.sample-buttons { | ||
margin-top: 24px; | ||
} | ||
|
||
[igxButton]+[igxButton] { | ||
margin-left: 8px; | ||
} | ||
|
||
|
||
:host::ng-deep { | ||
.test1 { | ||
color: red; | ||
font-weight: bold; | ||
background-color: yellow; | ||
} | ||
.test2 { | ||
color: blue; | ||
font-weight: bold; | ||
background-color: salmon; | ||
} | ||
.test3 { | ||
color: black !important; | ||
font-weight: bold !important; | ||
background-color: greenyellow !important; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object.entries
is not supported in IE. Can we add a polyfill for it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A polyfill was added with this PR #2279. We will take care to add a note for it in the documentation.