I have an sap.ui.Table
that shows a list of records. I want to get a count of the records in the data.
I have read the post SAP UI 5 how to print total table row , but it hasn't helped me.
This is the code for the table (code for the columns has been removed to make the post smaller):
<table:Table id="PickRecs" visibleRowCount="10" selectionMode="MultiToggle" visible="true" rows="{/downRecs}" >
<table:title>
<txt:Text text="{
path: '/downRecs',
formatter: 'Formatter.totalFormatter'
}">
</txt:Text>
<Label text="possible records to export"></Label>
</table:title>
<table:columns>
.......
</table:columns>
</table:Table>
This is the formatter.js:
totalFormatter:function(results) {
return results.length;
}
I would like to display how many rows there are in the table using the array downRecs
as the source of all the records. For example: 3 possible records to export.
This value can change based on some input fields on the screen, for example they can choose to see all records for a product or only records for a certain customer, etc.
How can I get this updated count of the records? This value is shown on the toolbar or title of the table.