How to create a complex header in vaadin 7?

坚强是说给别人听的谎言 提交于 2019-12-12 12:15:09

问题


I was using setColumnHeader(Object, String) to set a simple string as a column header. I want to create a complex header. I would like to know if there is any way to build a similar table as shown in the below figure in Vaadin 7. http://i.stack.imgur.com/u5dIw.gif


回答1:


Now it is possible using Grid:

// Group headers by joining the cells
HeaderRow groupingHeader = grid.prependHeaderRow();
HeaderCell namesCell = groupingHeader.join(
    groupingHeader.getCell("firstname"),
    groupingHeader.getCell("lastname"));
HeaderCell yearsCell = groupingHeader.join(
    groupingHeader.getCell("born"),
    groupingHeader.getCell("died"),
    groupingHeader.getCell("lived"));

This example is taken from Vaadin Book. Just to show that new Vaadin 7.5 (and above) can build table with complex header (joined columns). Another good resource is in Vaadin Wiki.

As you notice such grouping is also possible for footer row.




回答2:


Not at the moment.

It is scheduled for vaadin 7.4, which is currently in alpha stage.



来源:https://stackoverflow.com/questions/26712847/how-to-create-a-complex-header-in-vaadin-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!