Skip to Content
0

sap.ui.table.Table filter event triggers before filtering values.

Apr 13 at 07:11 AM

25

avatar image

Hello everyone,

I'm using a sap.ui.table.Table and show a column's summation value in the table's footer. I have a requirement where the summation value should update after the table is filtered with the sum of visible rows only.

I'm using the sap.ui.table.Table's filter event and here's how I get my visible rows:

var vRowIndices = oEvent.getSource().getBinding("rows").aIndices
var vRows = []
vRowIndices.forEach(function(i){
    vRows.push(sap.ui.getCore().getModel("oModel").getProperty("/"+i))
})

My issue is the filter event executes my code before the table is filtered and aIndices returns the indices of rows that were visible before the current filter is applied.


My current solution is to use a timeout and delay the above code'd execution to after the filtering is done, otherwise I get the previous state of the rows (before applying the filter)

setTimeout(function() {
    thiz.getColumnSummation(oEvent);
}, 100);

This solution works but isn't ideal, I'm looking for a better way to implement this.

Thanks!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers