igniteui-angular
igniteui-angular copied to clipboard
Add [paginatorTemplate] parameter to IgxGrid and IgxTreeGrid
Is your feature request related to a problem? Please describe.
Currently, I have to duplicate the <igx-paginator> code every time I want to implement an IgxGrid or IgxTreeGrid
Describe the solution you'd like
I would like to be able to reuse the same <igx-paginator> on all my IgxGrid/IgxTreeGrid implementations, in my case I think the most natural way is to keep the Angular content or inline template, the following example would be ideal:
<ng-template #paginator>
<igx-paginator *ngIf="paging">
<igx-paginator-content>
...
</igx-paginator-content>
</igx-paginator>
</ng-template>
<igx-grid #grid1 ... [paginatorTemplate]="paginator"> ... columns and more </igx-grid>
<igx-grid #grid2 ... [paginatorTemplate]="paginator"> ... other columns and more </igx-grid>
Describe alternatives you've considered
The only alternative I currently have seems to duplicate my code, an alternative expected result for this FR could be to print the template directly and receive additional parameters using a directive:
<ng-template #paginator>
<igx-paginator *ngIf="paging">
<igx-paginator-content>
...
</igx-paginator-content>
</igx-paginator>
</ng-template>
<igx-grid #grid1 ...>
<ng-container igxPaginator [ngTemplateOutlet]="paginator"></ng-container>
... columns and more
</igx-grid>
<igx-grid #grid2 ...>
<ng-container igxPaginator [ngTemplateOutlet]="paginator"></ng-container>
... columns and a lot more
</igx-grid>
Additional context
Breaking changes or new features might need to be replicated in a lot of places, this FR might solve version upgrade issues
I just wanted to let you know that I managed to partially solve this by using an <ng-container> inside <igx-paginator-content>, I still have to duplicate the paginator attributes, the only workaround for that issue seems to set every attribute using setters
There has been no recent activity and this issue has been marked inactive.
There has been no recent activity and this issue has been marked inactive.