I'm submitting a ... (check one with "x")
[ ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
Current behavior
Expected behavior
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Angular version: 2.0.X
PrimeNG version: 2.0.X
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
Node (for AoT issues): node --version =
Just add a reference to the datatable component and access the totalRecords attribute.
<p-dataTable #table></p-dataTable>
{{ table.totalRecords }}
onFilter also gives filteredData which you can get the length from.
onFilter also gives filteredData which you can get the length from.
How does one implement this one,i want to return number of rows after filter
onFilter also gives filteredData which you can get the length from.
How does one implement this one,i want to return number of rows after filter
hey @RendyRex did you find anything to solve your problem. im facing the same right now.
now it's p-table ..to get the count of the filtered values (Displayed Rows) you can do this :
<p-table #dt .... (onFilter)="onFilter($event, dt)">
onFilter(event, dt) {
this.filteredValuesLength = event.filteredValue.length; // count of displayed rows
}
for anyone else coming here to find a simple solution with pTable (TurboTable), you can do it directly in the template with {{ dt.filteredValue.length }}.
It doesn't seem to be documented, but filteredValue is a member of the table component
@daleclements you are lifesaver!
Expanded a bit - the dt.filteredValue is not populated until some filtering actually happens. For inspiration
Showing {{dt.filteredValue?dt.filteredValue.length:dt.totalRecords}} of {{dt.totalRecords}} entries.
Most helpful comment
Just add a reference to the datatable component and access the totalRecords attribute.