Skip to content

How to use filter with PagingGrid ? #13

Description

@rucko24

Hello,

This PagingGrid looks quite nice and useful, is it possible to add a typical textfield filter as in the vaadin doc ? where is that TextField used with a GridListDataView ?


When I use the paginate button, the filter is kind of lost.

Image

            this.grid.setPagingDataProvider((page, pageSize) -> {
                // This is demo specific line, normally, e.g. with spring data, page number is
                // enough
                int start = (int) (page * this.grid.getPageSize());
                // Optional, sorting
//            if (!this.grid.getSortOrder().isEmpty()) {
//                GridSortOrder<HexDumpDto> sortOrder = this.grid.getSortOrder().get(0);
//                String propertyId = sortOrder.getSorted().getKey();
//                boolean asc = sortOrder.getDirection() == SortDirection.ASCENDING;
//                return this.hexDumpServiceImpl.findAll(PageRequest.of(0,10));
//            }
                return this.hexDumpServiceImpl.findAll(PageRequest.of(start,10));
            });

            this.gridListDataView = this.grid.setItems(this.hexDumpServiceImpl.findAll());
        this.searchTextField.addValueChangeListener(valueChangeEvent -> this.gridListDataView.refreshAll());

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions