@@ -1474,23 +1474,99 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
14741474 @ContentChild ( IgxExcelStyleHeaderIconDirective , { read : TemplateRef } )
14751475 public excelStyleHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
14761476
1477+
14771478 /**
1478- * The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in asc order.
1479+ * @hidden
1480+ * @internal
14791481 */
14801482 @ContentChild ( IgxSortAscendingHeaderIconDirective , { read : TemplateRef } )
1481- public sortAscendingHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
1483+ public sortAscendingHeaderIconDirectiveTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
14821484
14831485 /**
1484- * The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in desc order.
1486+ * The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in asc order.
1487+ */
1488+ @Input ( )
1489+ public get sortAscendingHeaderIconTemplate ( ) : TemplateRef < IgxGridHeaderTemplateContext > {
1490+ return this . _sortAscendingHeaderIconTemplate ;
1491+ }
1492+
1493+ /**
1494+ * Sets a custom template that should be used when rendering a header sorting indicator when columns are sorted in asc order.
1495+ *```html
1496+ * <ng-template #template igxSortAscendingHeaderIcon>
1497+ * <igx-icon>expand_less</igx-icon>
1498+ * </ng-template>
1499+ * ```
1500+ * ```typescript
1501+ * @ViewChild ("'template'", {read: TemplateRef })
1502+ * public template: TemplateRef<any>;
1503+ * this.grid.sortAscendingHeaderIconTemplate = this.template;
1504+ * ```
14851505 */
1506+ public set sortAscendingHeaderIconTemplate ( template : TemplateRef < IgxGridHeaderTemplateContext > ) {
1507+ this . _sortAscendingHeaderIconTemplate = template ;
1508+ }
1509+
1510+
14861511 @ContentChild ( IgxSortDescendingHeaderIconDirective , { read : TemplateRef } )
1487- public sortDescendingHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
1512+ public sortDescendingHeaderIconDirectiveTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
14881513
14891514 /**
1490- * The custom template, if any, that should be used when rendering a header sorting indicator when columns are not sorted.
1515+ * The custom template, if any, that should be used when rendering a header sorting indicator when columns are sorted in desc order.
1516+ */
1517+ @Input ( )
1518+ public get sortDescendingHeaderIconTemplate ( ) {
1519+ return this . _sortDescendingHeaderIconTemplate ;
1520+ }
1521+
1522+ /**
1523+ * Sets a custom template that should be used when rendering a header sorting indicator when columns are sorted in desc order.
1524+ *```html
1525+ * <ng-template #template igxSortDescendingHeaderIcon>
1526+ * <igx-icon>expand_more</igx-icon>
1527+ * </ng-template>
1528+ * ```
1529+ * ```typescript
1530+ * @ViewChild ("'template'", {read: TemplateRef })
1531+ * public template: TemplateRef<any>;
1532+ * this.grid.sortDescendingHeaderIconTemplate = this.template;
1533+ * ```
1534+ */
1535+ public set sortDescendingHeaderIconTemplate ( template : TemplateRef < IgxGridHeaderTemplateContext > ) {
1536+ this . _sortDescendingHeaderIconTemplate = template ;
1537+ }
1538+
1539+ /**
1540+ * @hidden
1541+ * @internal
14911542 */
14921543 @ContentChild ( IgxSortHeaderIconDirective , { read : TemplateRef } )
1493- public sortHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
1544+ public sortHeaderIconDirectiveTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
1545+
1546+ /**
1547+ * Gets custom template, if any, that should be used when rendering a header sorting indicator when columns are not sorted.
1548+ */
1549+ @Input ( )
1550+ public get sortHeaderIconTemplate ( ) : TemplateRef < IgxGridHeaderTemplateContext > {
1551+ return this . _sortHeaderIconTemplate ;
1552+ }
1553+
1554+ /**
1555+ * Sets a custom template that should be used when rendering a header sorting indicator when columns are not sorted.
1556+ *```html
1557+ * <ng-template #template igxSortHeaderIcon>
1558+ * <igx-icon>unfold_more</igx-icon>
1559+ * </ng-template>
1560+ * ```
1561+ * ```typescript
1562+ * @ViewChild ("'template'", {read: TemplateRef })
1563+ * public template: TemplateRef<any>;
1564+ * this.grid.sortHeaderIconTemplate = this.template;
1565+ * ```
1566+ */
1567+ public set sortHeaderIconTemplate ( template : TemplateRef < IgxGridHeaderTemplateContext > ) {
1568+ this . _sortHeaderIconTemplate = template ;
1569+ }
14941570
14951571 /**
14961572 * @hidden
@@ -3048,6 +3124,9 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
30483124 private readonly DRAG_SCROLL_DELTA = 10 ;
30493125 private _dataCloneStrategy : IDataCloneStrategy = new DefaultDataCloneStrategy ( ) ;
30503126 private _autoSize = false ;
3127+ private _sortHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
3128+ private _sortAscendingHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
3129+ private _sortDescendingHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > = null ;
30513130
30523131 /**
30533132 * @hidden @internal
@@ -3621,6 +3700,18 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
36213700 * @hidden
36223701 */
36233702 public ngAfterContentInit ( ) {
3703+ if ( this . sortHeaderIconDirectiveTemplate ) {
3704+ this . sortHeaderIconTemplate = this . sortHeaderIconDirectiveTemplate ;
3705+ }
3706+
3707+ if ( this . sortAscendingHeaderIconDirectiveTemplate ) {
3708+ this . sortAscendingHeaderIconTemplate = this . sortAscendingHeaderIconDirectiveTemplate ;
3709+ }
3710+
3711+ if ( this . sortDescendingHeaderIconDirectiveTemplate ) {
3712+ this . sortDescendingHeaderIconTemplate = this . sortDescendingHeaderIconDirectiveTemplate ;
3713+ }
3714+
36243715 this . setupColumns ( ) ;
36253716 this . toolbar . changes . pipe ( filter ( ( ) => ! this . _init ) , takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => this . notifyChanges ( true ) ) ;
36263717 this . setUpPaginator ( ) ;
0 commit comments