Skip to content

Commit 68146d5

Browse files
MKirovaMKirova
authored andcommitted
feat(igxGrid): Add row edit related template inputs.
1 parent 2ab4d30 commit 68146d5

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,18 +1313,90 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
13131313
@ContentChildren(IgxRowEditTextDirective, { descendants: false, read: TemplateRef })
13141314
public rowEditTextDirectives: QueryList<TemplateRef<any>>;
13151315

1316+
/**
1317+
* Gets the row edit text template.
1318+
*/
1319+
@Input()
1320+
public get rowEditTextTemplate(): TemplateRef<any> {
1321+
return this._rowEditTextTemplate || this.rowEditTextDirectives.first;
1322+
}
1323+
/**
1324+
* Sets the row edit text template.
1325+
*```html
1326+
* <ng-template #template igxRowEditText let-rowChangesCount>
1327+
* Changes: {{rowChangesCount}}
1328+
* </ng-template>
1329+
* ```
1330+
*```typescript
1331+
* @ViewChild('template', {read: TemplateRef })
1332+
* public template: TemplateRef<any>;
1333+
* this.grid.rowEditTextTemplate = this.template;
1334+
* ```
1335+
*/
1336+
public set rowEditTextTemplate(template: TemplateRef<any>) {
1337+
this._rowEditTextTemplate = template;
1338+
}
1339+
13161340
/**
13171341
* @hidden @internal
13181342
*/
13191343
@ContentChild(IgxRowAddTextDirective, { read: TemplateRef })
13201344
public rowAddText: TemplateRef<any>;
13211345

1346+
/**
1347+
* Gets the row add text template.
1348+
*/
1349+
@Input()
1350+
public get rowAddTextTemplate(): TemplateRef<any> {
1351+
return this._rowAddTextTemplate || this.rowAddText;
1352+
}
1353+
/**
1354+
* Sets the row add text template.
1355+
*```html
1356+
* <ng-template #template igxRowAddText>
1357+
* Adding Row
1358+
* </ng-template>
1359+
* ```
1360+
*```typescript
1361+
* @ViewChild('template', {read: TemplateRef })
1362+
* public template: TemplateRef<any>;
1363+
* this.grid.rowAddTextTemplate = this.template;
1364+
* ```
1365+
*/
1366+
public set rowAddTextTemplate(template: TemplateRef<any>) {
1367+
this._rowAddTextTemplate = template;
1368+
}
1369+
13221370
/**
13231371
* @hidden @internal
13241372
*/
13251373
@ContentChildren(IgxRowEditActionsDirective, { descendants: false, read: TemplateRef })
13261374
public rowEditActionsDirectives: QueryList<TemplateRef<any>>;
13271375

1376+
/**
1377+
* Gets the row edit actions template.
1378+
*/
1379+
@Input()
1380+
public get rowEditActionsTemplate(): TemplateRef<any> {
1381+
return this._rowEditActionsTemplate || this.rowEditActionsDirectives.first;
1382+
}
1383+
/**
1384+
* Sets the row edit actions template.
1385+
*```html
1386+
* <ng-template #template igxRowEditActions let-endRowEdit>
1387+
* <button igxButton igxRowEditTabStop (click)="endRowEdit(false)">Cancel</button>
1388+
* <button igxButton igxRowEditTabStop (click)="endRowEdit(true)">Apply</button>
1389+
* </ng-template>
1390+
* ```
1391+
*```typescript
1392+
* @ViewChild('template', {read: TemplateRef })
1393+
* public template: TemplateRef<any>;
1394+
* this.grid.rowEditActionsTemplate = this.template;
1395+
* ```
1396+
*/
1397+
public set rowEditActionsTemplate(template: TemplateRef<any>) {
1398+
this._rowEditActionsTemplate = template;
1399+
}
13281400

13291401
/**
13301402
* The custom template, if any, that should be used when rendering a row expand indicator.
@@ -2854,6 +2926,9 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
28542926
private _filteredSortedData = null;
28552927

28562928
private _customDragIndicatorIconTemplate: TemplateRef<any>;
2929+
private _rowEditTextTemplate: TemplateRef<any>;
2930+
private _rowAddTextTemplate: TemplateRef<any>;
2931+
private _rowEditActionsTemplate: TemplateRef<any>;
28572932
private _cdrRequests = false;
28582933
private _resourceStrings;
28592934
private _emptyGridMessage = null;

0 commit comments

Comments
 (0)