@@ -1227,6 +1227,33 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
12271227 @ContentChildren ( IgxRowDragGhostDirective , { read : TemplateRef , descendants : false } )
12281228 public dragGhostCustomTemplates : QueryList < TemplateRef < IgxGridRowDragGhostContext > > ;
12291229
1230+
1231+ /**
1232+ * Gets the custom template, if any, used for row drag ghost.
1233+ */
1234+ @Input ( )
1235+ public get dragGhostCustomTemplate ( ) {
1236+ return this . _dragGhostCustomTemplate || this . dragGhostCustomTemplates . first ;
1237+ }
1238+
1239+ /**
1240+ * Sets a custom template for the row drag ghost.
1241+ *```html
1242+ * <ng-template #template igxRowDragGhost>
1243+ * <igx-icon>menu</igx-icon>
1244+ * </ng-template>
1245+ * ```
1246+ * ```typescript
1247+ * @ViewChild ("'template'", {read: TemplateRef })
1248+ * public template: TemplateRef<any>;
1249+ * this.grid.dragGhostCustomTemplate = this.template;
1250+ * ```
1251+ */
1252+ public set dragGhostCustomTemplate ( template : TemplateRef < IgxGridRowDragGhostContext > ) {
1253+ this . _dragGhostCustomTemplate = template ;
1254+ }
1255+
1256+
12301257 /**
12311258 * @hidden @internal
12321259 */
@@ -1332,18 +1359,90 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
13321359 @ContentChildren ( IgxRowEditTextDirective , { descendants : false , read : TemplateRef } )
13331360 public rowEditTextDirectives : QueryList < TemplateRef < IgxGridRowEditTextTemplateContext > > ;
13341361
1362+ /**
1363+ * Gets the row edit text template.
1364+ */
1365+ @Input ( )
1366+ public get rowEditTextTemplate ( ) : TemplateRef < IgxGridRowEditTextTemplateContext > {
1367+ return this . _rowEditTextTemplate || this . rowEditTextDirectives . first ;
1368+ }
1369+ /**
1370+ * Sets the row edit text template.
1371+ *```html
1372+ * <ng-template #template igxRowEditText let-rowChangesCount>
1373+ * Changes: {{rowChangesCount}}
1374+ * </ng-template>
1375+ * ```
1376+ *```typescript
1377+ * @ViewChild ('template', {read: TemplateRef })
1378+ * public template: TemplateRef<any>;
1379+ * this.grid.rowEditTextTemplate = this.template;
1380+ * ```
1381+ */
1382+ public set rowEditTextTemplate ( template : TemplateRef < IgxGridRowEditTextTemplateContext > ) {
1383+ this . _rowEditTextTemplate = template ;
1384+ }
1385+
13351386 /**
13361387 * @hidden @internal
13371388 */
13381389 @ContentChild ( IgxRowAddTextDirective , { read : TemplateRef } )
13391390 public rowAddText : TemplateRef < IgxGridEmptyTemplateContext > ;
13401391
1392+ /**
1393+ * Gets the row add text template.
1394+ */
1395+ @Input ( )
1396+ public get rowAddTextTemplate ( ) : TemplateRef < IgxGridEmptyTemplateContext > {
1397+ return this . _rowAddTextTemplate || this . rowAddText ;
1398+ }
1399+ /**
1400+ * Sets the row add text template.
1401+ *```html
1402+ * <ng-template #template igxRowAddText>
1403+ * Adding Row
1404+ * </ng-template>
1405+ * ```
1406+ *```typescript
1407+ * @ViewChild ('template', {read: TemplateRef })
1408+ * public template: TemplateRef<any>;
1409+ * this.grid.rowAddTextTemplate = this.template;
1410+ * ```
1411+ */
1412+ public set rowAddTextTemplate ( template : TemplateRef < IgxGridEmptyTemplateContext > ) {
1413+ this . _rowAddTextTemplate = template ;
1414+ }
1415+
13411416 /**
13421417 * @hidden @internal
13431418 */
13441419 @ContentChildren ( IgxRowEditActionsDirective , { descendants : false , read : TemplateRef } )
13451420 public rowEditActionsDirectives : QueryList < TemplateRef < IgxGridRowEditActionsTemplateContext > > ;
13461421
1422+ /**
1423+ * Gets the row edit actions template.
1424+ */
1425+ @Input ( )
1426+ public get rowEditActionsTemplate ( ) : TemplateRef < IgxGridRowEditActionsTemplateContext > {
1427+ return this . _rowEditActionsTemplate || this . rowEditActionsDirectives . first ;
1428+ }
1429+ /**
1430+ * Sets the row edit actions template.
1431+ *```html
1432+ * <ng-template #template igxRowEditActions let-endRowEdit>
1433+ * <button igxButton igxRowEditTabStop (click)="endRowEdit(false)">Cancel</button>
1434+ * <button igxButton igxRowEditTabStop (click)="endRowEdit(true)">Apply</button>
1435+ * </ng-template>
1436+ * ```
1437+ *```typescript
1438+ * @ViewChild ('template', {read: TemplateRef })
1439+ * public template: TemplateRef<any>;
1440+ * this.grid.rowEditActionsTemplate = this.template;
1441+ * ```
1442+ */
1443+ public set rowEditActionsTemplate ( template : TemplateRef < IgxGridRowEditActionsTemplateContext > ) {
1444+ this . _rowEditActionsTemplate = template ;
1445+ }
13471446
13481447 /**
13491448 * The custom template, if any, that should be used when rendering a row expand indicator.
@@ -2395,24 +2494,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
23952494 }
23962495
23972496 /**
2398- * @hidden @internal
2399- */
2400- public get rowEditText ( ) : TemplateRef < IgxGridRowEditTextTemplateContext > {
2401- if ( this . rowEditTextDirectives && this . rowEditTextDirectives . first ) {
2402- return this . rowEditTextDirectives . first ;
2403- }
2404- return null ;
2405- }
2406-
2407- /**
2408- * @hidden @internal
2409- */
2410- public get rowEditActions ( ) : TemplateRef < IgxGridRowEditActionsTemplateContext > {
2411- if ( this . rowEditActionsDirectives && this . rowEditActionsDirectives . first ) {
2412- return this . rowEditActionsDirectives . first ;
2413- }
2414- return null ;
2415- }
24162497
24172498 /**
24182499 * @hidden @internal
@@ -2424,10 +2505,24 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
24242505 /**
24252506 * The custom template, if any, that should be used when rendering the row drag indicator icon
24262507 */
2508+ @Input ( )
24272509 public get dragIndicatorIconTemplate ( ) : TemplateRef < IgxGridEmptyTemplateContext > {
24282510 return this . _customDragIndicatorIconTemplate || this . dragIndicatorIconTemplates . first ;
24292511 }
24302512
2513+ /**
2514+ * Sets a custom template that should be used when rendering the row drag indicator icon.
2515+ *```html
2516+ * <ng-template #template igxDragIndicatorIcon>
2517+ * <igx-icon>expand_less</igx-icon>
2518+ * </ng-template>
2519+ * ```
2520+ * ```typescript
2521+ * @ViewChild ("'template'", {read: TemplateRef })
2522+ * public template: TemplateRef<any>;
2523+ * this.grid.dragIndicatorIconTemplate = this.template;
2524+ * ```
2525+ */
24312526 public set dragIndicatorIconTemplate ( val : TemplateRef < IgxGridEmptyTemplateContext > ) {
24322527 this . _customDragIndicatorIconTemplate = val ;
24332528 }
@@ -2899,6 +2994,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
28992994
29002995 private _customDragIndicatorIconTemplate : TemplateRef < IgxGridEmptyTemplateContext > ;
29012996 private _excelStyleHeaderIconTemplate : TemplateRef < IgxGridHeaderTemplateContext > ;
2997+ private _rowEditTextTemplate : TemplateRef < IgxGridRowEditTextTemplateContext > ;
2998+ private _rowAddTextTemplate : TemplateRef < IgxGridEmptyTemplateContext > ;
2999+ private _rowEditActionsTemplate : TemplateRef < IgxGridRowEditActionsTemplateContext > ;
3000+ private _dragGhostCustomTemplate : TemplateRef < IgxGridRowDragGhostContext > ;
29023001 private _cdrRequests = false ;
29033002 private _resourceStrings ;
29043003 private _emptyGridMessage = null ;
@@ -3789,11 +3888,8 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
37893888 * @internal
37903889 */
37913890 public getDragGhostCustomTemplate ( ) {
3792- if ( this . dragGhostCustomTemplates && this . dragGhostCustomTemplates . first ) {
3793- return this . dragGhostCustomTemplates . first ;
3794- }
37953891
3796- return null ;
3892+ return this . dragGhostCustomTemplate ;
37973893 }
37983894
37993895 /**
0 commit comments