-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templating in Column Header/Footer #98
Comments
We'll do it, thank you. |
Blocked by; |
Figured out a way to do it finally. |
Field data of a corresponding row is displayed as the cell content by default, this can be customized using templating where the implicit variable passed to the template is the column definition and data of current row is the rowData property. In addition index of the current can be accessed using the optional rowIndex variable. Similarly, custom content can be placed at the header and footer of a column with templating. A template inside a column must be decorated with pTemplate directive along with the type property to indicate where the template belongs to. Possible values are "header", "body" and "footer". <p-column field="color" header="Color">
<template let-col #car="rowData" #ri="rowIndex" pTemplate type="body">
<span">{{car[col.field]}}</span>
</template>
</p-column>
<p-column>
<template pTemplate type="header">
<button type="button" pButton (click)="selectAllCars()" icon="fa-check"></button>
</template>
<template let-car="rowData" pTemplate type="body">
<button type="button" pButton (click)="selectCar(car)" icon="fa-search"></button>
</template>
</p-column> |
I am having a difficult time getting the type="header" to show anything. The type="body" seems to work. Am importing: Is there something else that needs to be included for it to work? |
Hello PrimeNG Team, I have isolated the problem with type="header". It does not work when setting scrollable="true". Without the "scrollable" attribute, it works fine. Thanks |
Hi PrimeNG Team, is this still being worked on? The issue is closed, but we can still reproduce it with beta 17. As @mcfin1 said, it works without the scrollable attribute. |
I submitted pull request #938. It fixes cause of the issue. So far, no action on the pull request. The template used in the source needs to repeat code for "scrollable". |
p-footerColumnGroup also doesn't show up if you have scrollable="true". Does anyone have a work around for this? (On primeng 1.1.1 with angular 2.4.0) |
@johnhwright I found a solution. I added one more p-dataTable under the table and which contains only the footer. I have set class="footer" so I can separate the tables. And I set the display of the footer's dataTable's body to none. Here is the html code: And to override the css put this in the .css component Sorry for the bad code example |
How can I use |
@soyiatgit Yea, "rowIndex" doesnt work also. @cagataycivici Is there any possibility to access the rowIndex or the whole object inside the rowgroupfooter template? |
(Draft) Global filter state instead of diff-based approach primefaces#98
Hi Prime Team,
I would reuqest you to for a new feature, allow templating in column header or footer.
It will allow doing some custom functionalities to utilize grid functions more easily.
Thank you.
The text was updated successfully, but these errors were encountered: