parttio / grid-pagination

Adding pagination feature to a Vaadin 10 Grid component
Other
22 stars 16 forks source link

add support for query filtering #18

Closed etrandafir93 closed 1 year ago

etrandafir93 commented 3 years ago

hey, thanks for the time and effort invested in this component.

we would need the ability to send some filtering fields to the dataProvider through the InnerQuery.

the api would look like this:

@Data
public static class CustomFilter {
    private String name;
}

[...]

PaginatedGrid<Person, CustomFilter> grid = new PaginatedGrid<>();
grid.setDataProvider(personService);
grid.setFilter(filter);

and, on the dataProvider:

PersonService extends AbstractBackEndDataProvider<Person, CustomFilter> {

[...]

    @Override
    protected Stream<BonusWalletDefinition> fetchFromBackEnd(Query<BonusWalletDefinition, CustomFilter> query) {
    CustomFilter filter = query.getFilter().orElseThrow();
        return findByName( filter.getName() );
    }

}

do you have something similar or do you think something like this can be added? I would really need this.

Thank you, Emanuel