PDA

View Full Version : [FNR][1.2.4] Column not hidden anymore in Grid with showGroupedColumn=false



z013908
28 Apr 2009, 5:24 AM
Hello,

After upgrading to 1.2.4, I have a problem with grouping in grids in my app.

When using a GroupingView and setting attribute showGroupedColumn to false, if grouping is set on a model's field then the corresponding column is not hidden.

After going through GXT sources, I have found that line 428 of class GroupingView.java has been changed from :


cm.setHidden(colIndex, true); // in GXT 1.2.2 and GXT 1.2.3to :


cm.setHidden(colIndex, false); // in GXT 1.2.4This clearly explains why grouping columns are not hidden.

Could you fix this ?

Thanks.

darrellmeyer
30 Apr 2009, 8:51 PM
Fixed in SVN.

gelgey
12 Jun 2009, 3:51 AM
I am using GXT 1.2.4 and had the same issue.

For various reasons I can only use the distributed GXT 1.2.4 jar, so the SVN fix is not an option. However I did come up with the following work-around:



final String groupColumnId = ...; // the ID of your grouping column
Grid<ModelData> grid = new Grid<ModelData>(...);
GroupingView view = new GroupingView() {
@Override protected String renderRows(int startRow, int endRow) {
String result = super.renderRows(startRow, endRow);
this.cm.getColumnById(groupColumnId).setHidden(true);
return result;
}
};
grid.setView(view);
Hope that helps anyone else having the same problem.

z013908
12 Jun 2009, 4:27 AM
You just need to put the modified/corrected GroupingView.java in your classpath with a priority superior to gxt.jar (to do this you set the your src/ folder higher than the gxt.jar in your build classpath order) and the modified/corrected class will be used instead of the one from the gxt.jar.

gelgey
12 Jun 2009, 4:48 AM
You just need to put the modified/corrected GroupingView.java in your classpath with a priority superior to gxt.jar (to do this you set the your src/ folder higher than the gxt.jar in your build classpath order) and the modified/corrected class will be used instead of the one from the gxt.jar.
Thanks for the suggestion, but I am using Maven and if I start going that route then I may as well create a gxt-1.2.4-patch project, deploy it to my repository and add it as a dependency above gxt-1.2.4. Which I had considered but the PHBs were not too keen on the idea. So the workaround above will do for now.