Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
1.1.3, 1.1.5-SNAPSHOT
-
None
-
None
Description
Hi!
I'm using Extended Data Tables and wanted to use the column's groupBy. Now all normal tables of this project have rowStyles with alternating row-background-colors, so I tried to apply them also on the grouped data. It looks really bad, since the generated row-span messes up the layout.
The rowGroupStyle does not help - it's only useable as group separator style, therefor I think the name is a litte bit confusing - but that's another issue.
I suggest, that the rowStyles should work on groups rather than on rows. Tried to patch HtmlTableRenderer accordingly and works fine for me:
HtmlTableRenderer#createColumnInfos
[..]
int currentRowSpan=-1;
int currentRowInfoIndex=-1;
int groupCount = 0; // added by PP
TableContext tableContext=htmlDataTable.getTableContext();
[..]
if(groupEndReached)
rowInfo.setGroupIndex(groupCount); // added by PP
tableContext.getRowInfos().add(rowInfo);
HtmlTableRenderer#renderRowStyle
String rowStyleClass;
String rowStyle;
if (uiData instanceof HtmlDataTable)
{
HtmlDataTable datatable = (HtmlDataTable) uiData;
rowStyleClass = datatable.getRowStyleClass();
rowStyle = datatable.getRowStyle();
// added by PP
TableContext tableContext = datatable.getTableContext();
if (tableContext != null && tableContext.getRowInfos() != null && tableContext.getRowInfos().size() > rowStyleIndex)
RowInfo added
private int _groupIndex = -1;
public int getGroupIndex()
{ return _groupIndex; }public void setGroupIndex(int groupIndex)
{ _groupIndex = groupIndex; }