We would like to give users the ability to define the number of rows to return when calling grid.filterData(). So, if the filter condition they configure returns a total of 25 rows but they only want to see the top 10, we could pass a max param to filterData. How would this be possible?
Announcement
Collapse
No announcement yet.
X
-
There is a datasource. But, this particular use case is where we fetch data from the server and then do additional filtering that is purely client-side. So, if 100 rows come back from the server, we give the user the ability to filter them down to 25 with the filters they configure and then we want to give them the ability to define a max param to get down to 10 client-side. Does that make sense?
Comment
-
It is a normal datasource we use for server operations. No special protocols. Here is what the logic looks like. We fetch data from the server and create a local ResultSet and call setData on the grid and then call filterData on the grid to filter further. So, looking for a way to pass in an endRow or max param into that filterData call....
Code:var faResultSet = isc.ResultSet.create({ dataSource: FA, initialData: serverData, allRows:serverData, useClientFiltering:true, criteria:serverRequestCriteria, neverDropUpdatedRows:true }); faGrid.setData(faResultSet); faGrid.filterData(clientFilterCriteria);
Comment
-
The easiest thing is probably to switch from calling filterData() on the grid to calling setCriteria() on the ResultSet, then providing the first 10 rows from the ResultSet to the grid. Something like:
Code:faResultSet.setCriteria(clientFilterCriteria); faGrid.setData(faResultSet.getRange(0,10));
Comment
Comment