Grid2
Advanced filtering Grid . Customizable on server side
Grid component implementation. It extends functionality of Vaadin Table by adding:
advanced filtering
paging
grid data export to excel and csv
Grid supports the following operators for filtering by default:
Strings, Enums: contains, starts with, like, equal, not equal Numbers and Dates: equal, not equal, between, greater, less, greater or equal, less or equal Boolean: equal, not equal
The second version of Grid addon
Sample code
final Table table = new Table(); final List<Person> persons = createPersonList(); table.setContainerDataSource(new BeanItemContainer<Person>(Person.class, persons)); table.setWidth(100, Sizeable.UNITS_PERCENTAGE); int tableSize = table.size(); if (tableSize > 20) { table.setHeight(400, Sizeable.UNITS_PIXELS); } table.setPageLength(tableSize); table.setColumnCollapsingAllowed(true); table.setColumnReorderingAllowed(true); table.setVisibleColumns(new Object[] {"firstName", "lastName", "birthday", "score", "height", "female"}); table.setColumnHeaders(new String[]{"First Name", "Last Name", "Birthday", "Score", "Height", "Female"}); table.setSelectable(true);
final Grid grid = new Grid(table);
private List<Person> createPersonList() { final List<Person> persons = new ArrayList<Person>(); Person person; person = new Person(); person.setFirstName("Victoria"); person.setLastName("Azarenka"); setBirthday(person, "1989-07-31"); person.setScore(10595); person.setHeight(1.83f); persons.add(person); person = new Person(); person.setFirstName("Maria"); person.setLastName("Sharapova"); setBirthday(person, "1987-04-19"); person.setScore(10045); person.setHeight(1.88f); persons.add(person); person = new Person(); person.setFirstName("Serena"); person.setLastName("Williams"); setBirthday(person, "1981-09-26"); person.setScore(9750); person.setHeight(1.75f); persons.add(person); person = new Person(); person.setFirstName("Agnieszka"); person.setLastName("Radwanska"); setBirthday(person, "1989-03-06"); person.setScore(7505); person.setHeight(1.72f); persons.add(person); person = new Person(); person.setFirstName("Angelique"); person.setLastName("Kerber"); setBirthday(person, "1988-01-18"); person.setScore(5550); person.setHeight(1.73f); persons.add(person); return persons; }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Migrated to Vaadin 7.5.5 packages renamed from com.lexaden.grid to com.vaadin.grid
- Released
- 2016-02-03
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 7.5+
- Browser
- Browser Independent
Grid2 - Vaadin Add-on Directory
Advanced filtering Grid . Customizable on server sideGrid2 version 2.0.0
Migrated to Vaadin 7.5.5
packages renamed from com.lexaden.grid to com.vaadin.grid