This is a nonsense line of code that will crash, as the attribute is not allowed to be changed on the fly:
Code:
grid.getDataSource().setClientOnly(true);
Please see the docs for ListGrid.fetchData() for an explanation of when the ListGrid will fetch from the server or perform filtering on the client. You are probably just applying criteria that are less restrictive than the criteria currently on the grid, so a server trip is required. Possibly you need to combine the new criteria with the criteria already on the grid - your call to filterData() replaces the current criteria with your new criteria.
After doing these changes and server side changes , pagination is working fine.
On the same screen , i have one Search field on the click of which i do filtering on this criteria using AdvancedCritieria as below:
Code:
display.getSearchTextItem().addChangedHandler(event -> {
AdvancedCriteria criteria = new AdvancedCriteria(OperatorId.OR,
new Criterion[] { new Criterion("Code", OperatorId.ICONTAINS, input),
new Criterion("desc", OperatorId.ICONTAINS, input),
new Criterion("number", OperatorId.ICONTAINS, input),
new Criterion("address", OperatorId.ICONTAINS, input) });
grid.filterData(criteria);
});
The above filtering was working fine using client side filtering when there was no pagination. After doing pagination related changes, every keypress in Search Text item goes for server hit and filtering does not work.
Please note when there was no pagination, my DSRequest had FetchMode.BASIC for this grid.
I want to have pagination and client side filtering enabled on my Grid. Please help.
Leave a comment: