i habe a sap.ui.table.Table that uses a JON data model. a filter is applied to the table to 'hide' unwanted rows. how can i get a count if how many are left showing? thanks. pas.
Asked
Active
Viewed 1,369 times
0
-
In the linked answer, see the section "Using change event from `sap.ui.model.Binding`". The `onChange` handler should be triggered after filtering the table. There, you can call `.getLength()` from the listBinding object to retrieve the number of items left. Should be also working with a JSONModel. – Boghyon Hoffmann May 17 '20 at 11:00
-
Solved in https://answers.sap.com/answers/13051308/view.html – Boghyon Hoffmann May 18 '20 at 13:45
1 Answers
-2
Add a updateFinished handler to your table
<Table updateFinished="onTableUpdateFinished" ... >
and then you can get the row number in the controller like this:
onTableUpdateFinished: function (oEvent) {
var iRows = oEvent.getSource().getBinding("items").getLength();
}

Lumpenstein
- 1,250
- 1
- 10
- 27
-
The question author is using `sap.ui.table.Table` which has neither `updateFinished` nor `items`-aggregation. – Boghyon Hoffmann May 18 '20 at 08:02
-
Sorry I missed that part, my solution applies only to sap.m.Table. – Lumpenstein May 18 '20 at 08:08