Table colspan

Hi,

simple question: how can I do colspanning in Table? I’ve tried to search API docs and other places without luck.

Cheers
Olli

The short answer is you cannot.
The Table component is driven by a data model (Container) and is designed to display row-oriented data.

However, you can usually achieve the desired effect by using a GridLayout instead of a Table component. GridLayout permits you to specify a rectangular area of the grid for your component, and is often better suited for visually more complex layouts, where a part of or all of the structure is typically static. GridLayout can be used e.g. for reports with column spanning headers.

For very large tables containing a large number of components, GridLayout performance may not be very good. In these cases, you could also take a look at FastGrid in the incubator project FastLayouts, which implements most of the API of GridLayout. See
http://vaadin.com/forum/-/message_boards/message/18879
for more information.

Oh man :frowning: Data model driven approach suits very well on my usecase, I would just need to group rows every now and then by doing row with spanned columns with simple text inside.

I guess I’ll take a look GridLayout but otherwise Table is just perfect for my needs (columns and row selections etc).
I would think this kind of colspan feature would be usefeull for others as well?

One further question: is it possible to add checkbox to header row, it would be used for “select all” kind of functionality.

Would either of these feature requests solve your use-case?

If not, feel free to post a new feature request.

No, you have to put it as a button below the table. Sorry.

How about adding a feature request ticket for this too?

Hi,

thanks Joonas for reply. Ticket 3153 seems just the same as feature I asked, possibility to add optional “header” rows, but not just below real header, they should be allowed anywhere on table, for example summary row for calculated total amounts. Ticket 3152 refers to expandable detail row, that would also to the trick, could be just too “heavy” for general purpose colspannable row.

I’ll open new ticket for select all functionality!

Thanks
Olli

For the header checkbox (or handling click events from the header), there is a related request already - see
http://dev.vaadin.com/ticket/2825
. Maybe a comment in this one would be sufficient?

The correct way to handle this would probably be to support arbitrary components in the table header.

Henri you are right, that’s exactly right feature, and yes, checkbox is just one example header could support, other arbitrary components would be nice as well.

Btw, I cant register to Trac, when I post register form, server asks authentication, or maybe I’m missing something here :slight_smile: ?

That would be a footer, right? There’s a ticket about it:
http://dev.vaadin.com/ticket/3045
. I known at least one project which would gladly use that feature :slight_smile:

That’s right footer it is indeed :slight_smile: And yes, it would be very useful,almost must-have-feature, too.

It seems that something has broken the registration system. I’ll ask our Trac guru to take a look of it asap and email you a new trac account immediately.

Thx, it’s working now.

Hi, Joonas!

What about resolving this ticket
#3153
?
It would be great to have this feature!

Hello,

No news about
http://dev.vaadin.com/ticket/3153
?

I saw other discussion on the same problem i think :


https://vaadin.com/forum/-/message_boards/view_message/841466

Hello,
What about http://dev.vaadin.com/ticket/3153? I need this feature!

Que no se puede???

Cada vez me desepciona mas Vaadin, bueno si necesitan ayuda les puedo ayudar a agregarlo al framework.