Kandha
Kandha

Reputation: 3689

grid colspan does not work for IE in GWT

I was created the grid in GWT and set the attribute colspan for one row...

gridSample.setWidget(0, 0, new HTML("Can you improve this checklist?  Please rank and submit your comments below"));

gridSample.getCellFormatter().getElement(0, 0).setAttribute("colspan", "4");

The colspan does not work for IE...

Upvotes: 1

Views: 1324

Answers (3)

Lubagov
Lubagov

Reputation: 21

In IE has bug. When I use:

flexTable.getCellFormatter().getElement(hNum, 0).setAttribute("colspan", ""+colCount);

GWT writes attribute name as "colSpan" with upper case S, for IE (if open developer tools, in IE, I can see it) but IE8 ignored it, when I modify to "colspan" it correctly works. But I don't know, how to fix it in GWT... GWT writes it self... But it really works

flexTable.getFlexCellFormatter().setColSpan(hNum, 0, colCount);

Upvotes: 2

user877315
user877315

Reputation: 31

Try this:

gridSample.getCellFormatter().getElement(0, 0).setAttribute("colSpan", "4")

I mean use colSpan instead colspan.

Upvotes: 2

Hilbrand Bouwkamp
Hilbrand Bouwkamp

Reputation: 13519

I'm assuming your using the Grid class. This class is not intended to be used with flexible column and rows, thus setting colspan is not supported. If you want to set colspan, use the class FlexTable. It does support colspan. In your case when using FlexTable it looks:

gridSanple.getFlexCellFormatter().setColSpan(0, 0, 4);

However, note that FlexTable is much slower then Grid. So if you have a large table this might be an issue.

Upvotes: 0

Related Questions