use of com.vaadin.flow.component.grid.HeaderRow in project flow-components by vaadin.
the class JoinedHeadersPage method createGrid2.
private static Grid<String> createGrid2() {
Grid<String> grid = new Grid<>();
grid.setId("grid2");
addColumns(grid);
grid.appendHeaderRow();
HeaderRow header = grid.prependHeaderRow();
header.join(header.getCells()).setText("Title");
grid.setItems("1", "2", "3");
return grid;
}
use of com.vaadin.flow.component.grid.HeaderRow in project karnak by OsiriX-Foundation.
the class ExternalIDGrid method addFilterElements.
public void addFilterElements() {
HeaderRow filterRow = appendHeaderRow();
extidFilter = new TextField();
extidFilter.addValueChangeListener(event -> checkAndUpdateAllFilters());
extidFilter.setValueChangeMode(ValueChangeMode.EAGER);
filterRow.getCell(extidColumn).setComponent(extidFilter);
extidFilter.setSizeFull();
extidFilter.setPlaceholder(LABEL_FILTER);
patientIdFilter = new TextField();
patientIdFilter.addValueChangeListener(event -> checkAndUpdateAllFilters());
patientIdFilter.setValueChangeMode(ValueChangeMode.EAGER);
filterRow.getCell(patientIdColumn).setComponent(patientIdFilter);
patientIdFilter.setSizeFull();
patientIdFilter.setPlaceholder(LABEL_FILTER);
patientFirstNameFilter = new TextField();
patientFirstNameFilter.addValueChangeListener(event -> checkAndUpdateAllFilters());
patientFirstNameFilter.setValueChangeMode(ValueChangeMode.EAGER);
filterRow.getCell(patientFirstNameColumn).setComponent(patientFirstNameFilter);
patientFirstNameFilter.setSizeFull();
patientFirstNameFilter.setPlaceholder(LABEL_FILTER);
patientLastNameFilter = new TextField();
patientLastNameFilter.addValueChangeListener(event -> checkAndUpdateAllFilters());
patientLastNameFilter.setValueChangeMode(ValueChangeMode.EAGER);
filterRow.getCell(patientLastNameColumn).setComponent(patientLastNameFilter);
patientLastNameFilter.setSizeFull();
patientLastNameFilter.setPlaceholder(LABEL_FILTER);
issuerOfPatientIDFilter = new TextField();
issuerOfPatientIDFilter.addValueChangeListener(event -> checkAndUpdateAllFilters());
issuerOfPatientIDFilter.setValueChangeMode(ValueChangeMode.EAGER);
filterRow.getCell(issuerOfPatientIDColumn).setComponent(issuerOfPatientIDFilter);
issuerOfPatientIDFilter.setSizeFull();
issuerOfPatientIDFilter.setPlaceholder(LABEL_FILTER);
}
use of com.vaadin.flow.component.grid.HeaderRow in project karnak by OsiriX-Foundation.
the class TransferStatusGrid method createFiltersOnRows.
/**
* Create filters
*
* @param transferDateColumn Transfer Date column
* @param studyUidColumn Study Uid Column
* @param serieUidColumn Serie Uid Column
* @param sopInstanceUidColumn Sop Instance Uid Column
* @param statusColumn Status Column
*/
private void createFiltersOnRows(Column<TransferStatusEntity> transferDateColumn, Column<TransferStatusEntity> studyUidColumn, Column<TransferStatusEntity> serieUidColumn, Column<TransferStatusEntity> sopInstanceUidColumn, Column<TransferStatusEntity> statusColumn) {
// Filters
HeaderRow filterRow = appendHeaderRow();
transferStatusFilter = new TransferStatusFilter();
// Transfer date filter
createTransferDateFilter(transferDateColumn, filterRow);
// Study uid filter
createStudyUidFilter(studyUidColumn, filterRow);
// Serie uid filter
createSerieUidFilter(serieUidColumn, filterRow);
// Sop Instance uid filter
createSopInstanceUidFilter(sopInstanceUidColumn, filterRow);
// Sent status
createHasBeenSentFilter(statusColumn, filterRow);
}
use of com.vaadin.flow.component.grid.HeaderRow in project flow-components by vaadin.
the class GridViewHeaderAndFooterRowsPage method createHeaderAndFooterUsingComponents.
private void createHeaderAndFooterUsingComponents() {
Grid<Person> grid = new Grid<>();
grid.setItems(getItems());
Column<Person> nameColumn = grid.addColumn(Person::getFirstName).setHeader(new Span("Name")).setComparator((p1, p2) -> p1.getFirstName().compareToIgnoreCase(p2.getFirstName()));
Column<Person> ageColumn = grid.addColumn(Person::getAge, "age").setHeader(new Span("Age"));
Column<Person> streetColumn = grid.addColumn(person -> person.getAddress().getStreet()).setHeader(new Span("Street"));
Column<Person> postalCodeColumn = grid.addColumn(person -> person.getAddress().getPostalCode()).setHeader(new Span("Postal Code"));
HeaderRow topRow = grid.prependHeaderRow();
HeaderCell informationCell = topRow.join(nameColumn, ageColumn);
informationCell.setComponent(new Span("Basic Information"));
HeaderCell addressCell = topRow.join(streetColumn, postalCodeColumn);
addressCell.setComponent(new Span("Address Information"));
grid.appendFooterRow().getCell(nameColumn).setComponent(new Span("Total: " + getItems().size() + " people"));
grid.setId("grid-header-with-components");
addCard("Header and footer rows", "Header and footer using components", grid);
}
Aggregations