开发者

grid colspan does not work for IE in GWT

开发者 https://www.devze.com 2023-01-12 11:45 出处:网络
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\"));

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("cols开发者_JAVA百科pan", "4");

The colspan does not work for IE...


Try this:

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

I mean use colSpan instead colspan.


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);


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消