0

瓦丁 11.0.1

布局是一个顶部网格和一个底部网格(一个在左边,一个在右边)

这是我创建页面的方式:

public class InformationMainView extends VerticalLayout {
    private Grid<AdmisRejet> gridRejet = new Grid<>();
    private Grid<Entry<String, String>> admisPropertiesGrid = new Grid<>();
    private Grid<AdmisHistory> gridJobHistory= new Grid<>();

    public InformationMainView() {

        // history (top)
        gridJobHistory.setItems(admisHistoryRepository.findAllByOrderByJobExecutionDateDesc());
        gridJobHistory.addColumn(AdmisHistory::getJobExecutionDate).setHeader("Date Importation");
        gridJobHistory.addColumn(AdmisHistory::getCreatedBy).setHeader("Par");
        gridJobHistory.addColumn(AdmisHistory::getUai).setHeader("UAI");
        gridJobHistory.addColumn(admisHistory -> admisRejetRepository.findAdmisRejetByAdmisHistory(admisHistory).size()).setHeader("Nb Rejets");

        // reject (bottom left)
        gridRejet.addColumn(AdmisRejet::getTypeRejet).setHeader("Type rejet");
        gridRejet.addColumn(AdmisRejet::getInformation).setHeader("Valeur");
        gridRejet.addColumn(getBlockingIconRenderer()).setHeader("Bloquant");

        // details (bottom right)
        admisPropertiesGrid.addColumn(Entry::getKey).setHeader("Clé");
        admisPropertiesGrid.addColumn(Entry::getValue).setHeader("Valeur");

        add(gridJobHistory, new HorizontalLayout(gridRejet, admisPropertiesGrid));

底部没有渲染(甚至没有标题)。其中没有数据(正常,因为当我单击顶部网格时会填充数据)。

但我希望至少能看到列标题......

这是渲染: 在此处输入图像描述

4

1 回答 1

0

我通过强制宽度使它起作用:

HorizontalLayout bot = new HorizontalLayout();
bot.setWidth("100%");
bot.add(gridRejet, admisPropertiesGrid);
add(gridJobHistory, bot);
于 2018-12-03T03:34:06.940 回答