PDA

View Full Version : [OPEN] [FNR][2.0.1] Column Grouping Bug



Miggins
22 Jul 2009, 3:27 AM
There seems to be instances where an empty <td></td> is visible in the html when using HeaderGroupConfig.

This has the effect of pushing columns to the right out of alignment as illustrated in the attached image. Notice that 'Group 4' has been pushed to the right.

Column configuration to reproduce below (sorry have not got time to do a full test case) which you should be able to cut & paste this into a simple app...



private ColumnModel createColumns() {
ColumnConfig column1 = new ColumnConfig("Col1", "Column 1", 25);
ColumnConfig column2 = new ColumnConfig("Col2", "Column 2", 25);
ColumnConfig column3 = new ColumnConfig("Col3", "Column 3", 25);
ColumnConfig column4 = new ColumnConfig("Col4", "Column 4", 25);
ColumnConfig column5 = new ColumnConfig("Col5", "Column 5", 25);
ColumnConfig column6 = new ColumnConfig("Col6", "Column 6", 25);
ColumnConfig column7 = new ColumnConfig("Col7", "Column 7", 25);
ColumnConfig column8 = new ColumnConfig("Col8", "Column 8", 25);
ColumnConfig column9 = new ColumnConfig("Col9", "Column 9", 25);
ColumnConfig column10 = new ColumnConfig("Col10", "Column 10", 25);
ColumnConfig column11 = new ColumnConfig("Col11", "Column 11", 25);
ColumnConfig column12 = new ColumnConfig("Col12", "Column 12", 25);
ColumnConfig column13 = new ColumnConfig("Col13", "Column 13", 25);
ColumnConfig column14 = new ColumnConfig("Col14", "Column 14", 25);
ColumnConfig column15 = new ColumnConfig("Col15", "Column 15", 25);

List<ColumnConfig> columnConfigs = new ArrayList<ColumnConfig>();
columnConfigs.add(column1);
columnConfigs.add(column2);
columnConfigs.add(column3);
columnConfigs.add(column4);
columnConfigs.add(column5);
columnConfigs.add(column6);
columnConfigs.add(column7);
columnConfigs.add(column8);
columnConfigs.add(column9);
columnConfigs.add(column10);
columnConfigs.add(column11);
columnConfigs.add(column12);
columnConfigs.add(column13);
columnConfigs.add(column14);
columnConfigs.add(column15);

ColumnModel columnModel = new ColumnModel(columnConfigs);

HeaderGroupConfig group1 = new HeaderGroupConfig("Group 1", 2, 5);
HeaderGroupConfig group2 = new HeaderGroupConfig("Group 2", 2, 5);
HeaderGroupConfig group3 = new HeaderGroupConfig("Group 3", 1, 5);
HeaderGroupConfig group4 = new HeaderGroupConfig("Group 4", 1, 1);
HeaderGroupConfig group5 = new HeaderGroupConfig("Group 5", 1, 2);
HeaderGroupConfig group6 = new HeaderGroupConfig("Group 6", 1, 2);

columnModel.addHeaderGroup(0, 0, group1);
columnModel.addHeaderGroup(0, 5, group2);
columnModel.addHeaderGroup(0, 10, group3);
columnModel.addHeaderGroup(1, 10, group4);
columnModel.addHeaderGroup(1, 11, group5);
columnModel.addHeaderGroup(1, 13, group6);

return columnModel;

}
Cheers

Paul

Miggins
23 Jul 2009, 9:06 AM
OK so this test case should work...



package sky.sns.spm.web.spmapp.client.widget;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.extjs.gxt.ui.client.widget.grid.*;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.store.ListStore;

import java.util.List;
import java.util.ArrayList;

public class Test implements EntryPoint {

public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FitLayout());

GridView view = new GridView();
ListStore store = new ListStore();
Grid grid = new Grid(store, createColumns());
grid.setView(view);

viewport.add(grid);

RootPanel.get().add(viewport);
}

private ColumnModel createColumns() {
ColumnConfig column1 = new ColumnConfig("Col1", "Column 1", 25);
ColumnConfig column2 = new ColumnConfig("Col2", "Column 2", 25);
ColumnConfig column3 = new ColumnConfig("Col3", "Column 3", 25);
ColumnConfig column4 = new ColumnConfig("Col4", "Column 4", 25);
ColumnConfig column5 = new ColumnConfig("Col5", "Column 5", 25);
ColumnConfig column6 = new ColumnConfig("Col6", "Column 6", 25);
ColumnConfig column7 = new ColumnConfig("Col7", "Column 7", 25);
ColumnConfig column8 = new ColumnConfig("Col8", "Column 8", 25);
ColumnConfig column9 = new ColumnConfig("Col9", "Column 9", 25);
ColumnConfig column10 = new ColumnConfig("Col10", "Column 10", 25);
ColumnConfig column11 = new ColumnConfig("Col11", "Column 11", 25);
ColumnConfig column12 = new ColumnConfig("Col12", "Column 12", 25);
ColumnConfig column13 = new ColumnConfig("Col13", "Column 13", 25);
ColumnConfig column14 = new ColumnConfig("Col14", "Column 14", 25);
ColumnConfig column15 = new ColumnConfig("Col15", "Column 15", 25);

List<ColumnConfig> columnConfigs = new ArrayList<ColumnConfig>();
columnConfigs.add(column1);
columnConfigs.add(column2);
columnConfigs.add(column3);
columnConfigs.add(column4);
columnConfigs.add(column5);
columnConfigs.add(column6);
columnConfigs.add(column7);
columnConfigs.add(column8);
columnConfigs.add(column9);
columnConfigs.add(column10);
columnConfigs.add(column11);
columnConfigs.add(column12);
columnConfigs.add(column13);
columnConfigs.add(column14);
columnConfigs.add(column15);

ColumnModel columnModel = new ColumnModel(columnConfigs);

HeaderGroupConfig group1 = new HeaderGroupConfig("Group 1", 2, 5);
HeaderGroupConfig group2 = new HeaderGroupConfig("Group 2", 2, 5);
HeaderGroupConfig group3 = new HeaderGroupConfig("Group 3", 1, 5);
HeaderGroupConfig group4 = new HeaderGroupConfig("Group 4", 1, 1);
HeaderGroupConfig group5 = new HeaderGroupConfig("Group 5", 1, 2);
HeaderGroupConfig group6 = new HeaderGroupConfig("Group 6", 1, 2);

columnModel.addHeaderGroup(0, 0, group1);
columnModel.addHeaderGroup(0, 5, group2);
columnModel.addHeaderGroup(0, 10, group3);
columnModel.addHeaderGroup(1, 10, group4);
columnModel.addHeaderGroup(1, 11, group5);
columnModel.addHeaderGroup(1, 13, group6);

return columnModel;

}
}

Miggins
24 Jul 2009, 3:15 AM
Issues still exists in 2.0.1

sven
24 Jul 2009, 3:19 AM
It was not yet fixed. We will look into this for the next release.

Miggins
28 Jul 2009, 9:10 AM
Bump (sorry :s). Any idea when this will be fixed? I have a client hassling me.

darrellmeyer
29 Jul 2009, 6:56 AM
Fixed in SVN.

Jonny Campos
24 Nov 2009, 4:23 AM
Hello

I don't really know if this bug is related with the fixed one:

This is the code:

ColumnConfig columnInd1 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd2 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd3 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd4 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd5 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd6 = new ColumnConfig("Independiente", "Independiente", 25);

ColumnConfig column1 = new ColumnConfig("N2A", "Column N2A", 25);
ColumnConfig column2 = new ColumnConfig("N3B", "Column N3B", 25);
ColumnConfig column3 = new ColumnConfig("N4C", "Column N4C", 25);


List<ColumnConfig> columnConfigs = new ArrayList<ColumnConfig>();
columnConfigs.add(columnInd1);
columnConfigs.add(columnInd2);
columnConfigs.add(columnInd3);
columnConfigs.add(columnInd4);
columnConfigs.add(columnInd5);
columnConfigs.add(columnInd6);
columnConfigs.add(column1);
columnConfigs.add(column2);
columnConfigs.add(column3);


ColumnModel columnModel = new ColumnModel(columnConfigs);

HeaderGroupConfig group1 = new HeaderGroupConfig("N1A", 1, 1);
HeaderGroupConfig group2 = new HeaderGroupConfig("N1B", 1, 1);
HeaderGroupConfig group3 = new HeaderGroupConfig("N2B", 1, 1);
HeaderGroupConfig group4 = new HeaderGroupConfig("N1C", 1, 1);
HeaderGroupConfig group5 = new HeaderGroupConfig("N2C", 1, 1);
HeaderGroupConfig group6 = new HeaderGroupConfig("N3C", 1, 1);

columnModel.addHeaderGroup(0, 6, group1);
columnModel.addHeaderGroup(0, 7, group2);
columnModel.addHeaderGroup(1, 7, group3);
columnModel.addHeaderGroup(0, 8, group4);
columnModel.addHeaderGroup(1, 8, group5);
columnModel.addHeaderGroup(2, 8, group6);

return columnModel;


And the result is shown in the picture attached. As you can see, the last column has an empty cell, and although the NC4 cell seems to be empty, I can assure it is shifted to the hided column in the right of the grid...

The weird thing here is that it happens just for headers with lots of columns.

Is this the same bug? if so, is there any workaround can I use?

Thanks in advance

sven
24 Nov 2009, 4:27 AM
Please post a complete working testcase that implements entrypoint.

Jonny Campos
24 Nov 2009, 4:32 AM
Sorry...
That's the EntryPoint:


package sky.sns.spm.web.spmapp.client.widget;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.extjs.gxt.ui.client.widget.grid.*;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.store.ListStore;

import java.util.List;
import java.util.ArrayList;

public class Test implements EntryPoint {

public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FitLayout());

GridView view = new GridView();
ListStore store = new ListStore();
Grid grid = new Grid(store, createColumns());
grid.setView(view);

viewport.add(grid);

RootPanel.get().add(viewport);
}

private ColumnModel createColumns() {

ColumnConfig columnInd1 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd2 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd3 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd4 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd5 = new ColumnConfig("Independiente", "Independiente", 25);
ColumnConfig columnInd6 = new ColumnConfig("Independiente", "Independiente", 25);

ColumnConfig column1 = new ColumnConfig("N2A", "Column N2A", 25);
ColumnConfig column2 = new ColumnConfig("N3B", "Column N3B", 25);
ColumnConfig column3 = new ColumnConfig("N4C", "Column N4C", 25);


List<ColumnConfig> columnConfigs = new ArrayList<ColumnConfig>();
columnConfigs.add(columnInd1);
columnConfigs.add(columnInd2);
columnConfigs.add(columnInd3);
columnConfigs.add(columnInd4);
columnConfigs.add(columnInd5);
columnConfigs.add(columnInd6);
columnConfigs.add(column1);
columnConfigs.add(column2);
columnConfigs.add(column3);


ColumnModel columnModel = new ColumnModel(columnConfigs);

HeaderGroupConfig group1 = new HeaderGroupConfig("N1A", 1, 1);
HeaderGroupConfig group2 = new HeaderGroupConfig("N1B", 1, 1);
HeaderGroupConfig group3 = new HeaderGroupConfig("N2B", 1, 1);
HeaderGroupConfig group4 = new HeaderGroupConfig("N1C", 1, 1);
HeaderGroupConfig group5 = new HeaderGroupConfig("N2C", 1, 1);
HeaderGroupConfig group6 = new HeaderGroupConfig("N3C", 1, 1);
HeaderGroupConfig group7 = new HeaderGroupConfig("N3D", 1, 1);

columnModel.addHeaderGroup(0, 6, group1);
columnModel.addHeaderGroup(0, 7, group2);
columnModel.addHeaderGroup(1, 7, group3);
columnModel.addHeaderGroup(0, 8, group4);
columnModel.addHeaderGroup(1, 8, group5);
columnModel.addHeaderGroup(2, 8, group6);
columnModel.addHeaderGroup(3, 8, group7);

return columnModel;
}
}

sven
24 Nov 2009, 4:36 AM
This works fine against latest version

Jonny Campos
24 Nov 2009, 5:14 AM
Sorry, but the latest version is the 2.0.1, isn't it?

sven
24 Nov 2009, 5:15 AM
Latest version out of SVN.