File tree Expand file tree Collapse file tree 7 files changed +45
-22
lines changed
projects/igniteui-angular/src/lib/grids Expand file tree Collapse file tree 7 files changed +45
-22
lines changed Original file line number Diff line number Diff line change 2
2
< igx-chip *ngIf ="displayPinnedChip " class ="igx-grid__td--pinned-chip " [disabled] ="true " [displayDensity] ="'compact' "> {{ grid.resourceStrings.igx_grid_pinned_row_indicator }}</ igx-chip >
3
3
</ ng-template >
4
4
< ng-template #defaultCell >
5
- < div igxTextHighlight style ="pointer-events: none " [cssClass] ="highlightClass " [activeCssClass] ="activeHighlightClass " [groupName] ="gridID "
6
- [value] ="formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value "
7
- [row] ="rowData " [column] ="this.column.field " [containerClass] ="'igx-grid__td-text' " [metadata] ="searchMetadata "
8
- class ="igx-grid__td-text "> {{ formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal:
9
- grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</ div >
5
+ < div igxTextHighlight class ="igx-grid__td-text " style ="pointer-events: none "
6
+ [cssClass] ="highlightClass "
7
+ [activeCssClass] ="activeHighlightClass "
8
+ [groupName] ="gridID "
9
+ [value] ="formatter ? (value | columnFormatter:formatter) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value "
10
+ [row] ="rowData "
11
+ [column] ="this.column.field "
12
+ [containerClass] ="'igx-grid__td-text' "
13
+ [metadata] ="searchMetadata "> {{ formatter ? (value | columnFormatter:formatter) : column.dataType === 'number' ? (value | igxdecimal:grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</ div >
10
14
</ ng-template >
11
15
< ng-template #inlineEditor let-cell ="cell ">
12
16
< ng-container *ngIf ="column.dataType === 'string' ">
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ import {
14
14
IgxGridRowPinningPipe ,
15
15
IgxGridDataMapperPipe ,
16
16
IgxStringReplacePipe ,
17
- IgxGridTransactionStatePipe
17
+ IgxGridTransactionStatePipe ,
18
+ IgxColumnFormatterPipe
18
19
} from './pipes' ;
19
20
20
21
@NgModule ( {
@@ -32,7 +33,8 @@ import {
32
33
IgxGridRowPinningPipe ,
33
34
IgxGridDataMapperPipe ,
34
35
IgxStringReplacePipe ,
35
- IgxGridTransactionStatePipe
36
+ IgxGridTransactionStatePipe ,
37
+ IgxColumnFormatterPipe
36
38
] ,
37
39
exports : [
38
40
IgxDatePipeComponent ,
@@ -48,7 +50,8 @@ import {
48
50
IgxGridRowPinningPipe ,
49
51
IgxGridDataMapperPipe ,
50
52
IgxStringReplacePipe ,
51
- IgxGridTransactionStatePipe
53
+ IgxGridTransactionStatePipe ,
54
+ IgxColumnFormatterPipe
52
55
] ,
53
56
imports : [
54
57
CommonModule
Original file line number Diff line number Diff line change @@ -279,3 +279,11 @@ export class IgxGridTransactionStatePipe implements PipeTransform {
279
279
}
280
280
}
281
281
}
282
+
283
+ @Pipe ( { name : 'columnFormatter' } )
284
+ export class IgxColumnFormatterPipe implements PipeTransform {
285
+
286
+ transform ( value : any , formatter : ( v : any ) => any ) {
287
+ return formatter ( value ) ;
288
+ }
289
+ }
Original file line number Diff line number Diff line change @@ -881,8 +881,8 @@ export class LargePinnedColGridComponent implements OnInit {
881
881
this . data = SampleTestData . generateProductData ( 75 ) ;
882
882
}
883
883
884
- public returnVal ( ) {
885
- return this . value ;
884
+ public returnVal ( value ) {
885
+ return value ;
886
886
}
887
887
}
888
888
Original file line number Diff line number Diff line change 2
2
< igx-chip *ngIf ="displayPinnedChip " class ="igx-grid__td--pinned-chip " [disabled] ="true " [displayDensity] ="'compact' "> {{ grid.resourceStrings.igx_grid_pinned_row_indicator }}</ igx-chip >
3
3
</ ng-template >
4
4
< ng-template #defaultCell >
5
- < div igxTextHighlight style ="pointer-events: none " [cssClass] ="highlightClass " [activeCssClass] ="activeHighlightClass " [groupName] ="gridID "
6
- [value] ="formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value "
7
- [row] ="rowData " [column] ="this.column.field " [containerClass] ="'igx-grid__td-text' " [metadata] ="searchMetadata "
8
- class ="igx-grid__td-text "> {{ formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal:
9
- grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</ div >
5
+ < div igxTextHighlight class ="igx-grid__td-text " style ="pointer-events: none "
6
+ [cssClass] ="highlightClass "
7
+ [activeCssClass] ="activeHighlightClass "
8
+ [groupName] ="gridID "
9
+ [value] ="formatter ? (value | columnFormatter:formatter) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value "
10
+ [row] ="rowData "
11
+ [column] ="this.column.field "
12
+ [containerClass] ="'igx-grid__td-text' "
13
+ [metadata] ="searchMetadata "> {{ formatter ? (value | columnFormatter:formatter) : column.dataType === 'number' ? (value | igxdecimal:grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</ div >
10
14
</ ng-template >
11
15
< ng-template #inlineEditor let-cell ="cell ">
12
16
< ng-container *ngIf ="column.dataType === 'string' ">
Original file line number Diff line number Diff line change @@ -2415,8 +2415,8 @@ export class IgxGridFormattingComponent extends BasicGridComponent {
2415
2415
public width = '600px' ;
2416
2416
public height = '400px' ;
2417
2417
public value : any ;
2418
- public formatNum ( ) {
2419
- return this . value . toExponential ( ) . toString ( ) ;
2418
+ public formatNum ( value ) {
2419
+ return value . toExponential ( ) . toString ( ) ;
2420
2420
}
2421
2421
}
2422
2422
Original file line number Diff line number Diff line change 2
2
< igx-chip *ngIf ="displayPinnedChip " class ="igx-grid__td--pinned-chip " [disabled] ="true " [displayDensity] ="'compact' "> {{ grid.resourceStrings.igx_grid_pinned_row_indicator }}</ igx-chip >
3
3
</ ng-template >
4
4
< ng-template #defaultCell >
5
- < div igxTextHighlight style ="pointer-events: none " [cssClass] ="highlightClass " [activeCssClass] ="activeHighlightClass " [groupName] ="gridID "
6
- [value] ="formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value "
7
- [row] ="rowData " [column] ="this.column.field " [containerClass] ="'igx-grid__td-text' " [metadata] ="searchMetadata "
8
- class ="igx-grid__td-text "> {{ formatter ? formatter(value) : column.dataType === 'number' ? (value | igxdecimal:
9
- grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</ div >
5
+ < div igxTextHighlight class ="igx-grid__td-text " style ="pointer-events: none "
6
+ [cssClass] ="highlightClass "
7
+ [activeCssClass] ="activeHighlightClass "
8
+ [groupName] ="gridID "
9
+ [value] ="formatter ? (value | columnFormatter:formatter) : column.dataType === 'number' ? (value | igxdecimal: grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value "
10
+ [row] ="rowData "
11
+ [column] ="this.column.field "
12
+ [containerClass] ="'igx-grid__td-text' "
13
+ [metadata] ="searchMetadata "> {{ formatter ? (value | columnFormatter:formatter) : column.dataType === 'number' ? (value | igxdecimal:grid.locale) : column.dataType === 'date' ? (value | igxdate: grid.locale) : value }}</ div >
10
14
</ ng-template >
11
15
< ng-template #inlineEditor let-cell ="cell ">
12
16
< ng-container *ngIf ="column.dataType === 'string' ">
You can’t perform that action at this time.
0 commit comments