I have a table with 3 columns holding at most 6000 elements. Above that table I have a SearchField. When something is typed into the SearchField, the table is filtered by 2 of the 3 columns (using liveChange) like this:
var oTable = this.getView().byId("idMyTable");
var oBinding = oTable.getBinding("items");
oBinding.filter(new sap.ui.model.Filter([
new sap.ui.model.Filter("col1", sap.ui.model.FilterOperator.Contains, sInput),
new sap.ui.model.Filter("col2", sap.ui.model.FilterOperator.Contains, sInput),
], false), "Application");
While this solutions works, it needs almost 5 seconds to complete (for only 6000 elements in the table) and another bit of time until the data in the table is displayed again.
When the table is being filled, its size limit is set to the length of data which is in the model:
// rs0 is the result set of the db query which contains the data
tableModel.setSizeLimit(tableModel.getData().rs0.length);
When I omit the call for setSizeLimit the search is quiet fast but I can't scroll through all items in the table (not everything is displayed).
My questions is: How can I display all values in the table and keep a good search performance at the same time?
Thanks in advance!