PDA

View Full Version : [FNR] When traling column is made visible, horizontal scrollbar isn't updated



omalley
1 Nov 2010, 10:38 AM
GXT 2.2.0. GWT 2.0.4 and 2.1.0. Reproducible in dev mode aka "hosted" mode as well as compiled app. Reproducible in Chrome, IE, and FireFox.

To reproduce, run the example below making sure that the grid is wider than your browser window. The horizontal scrollbar should be visible. Then, show the hidden "J" column (last column) using the column menu. You cannot scroll to the right to display the "J" column. If you expand the window enough the J column becomes visible.

As a workaround, I'm looking at overriding GridView's updateColumnHidden(int, boolean) method to get a reference to get the scroller to update itself. I'm pretty early in the process so I'm not 100% sure that's the best solution.



import com.extjs.gxt.ui.client.Style;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootLayoutPanel;

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

public class ReproduceColumnHiddenBugContainer extends LayoutContainer implements EntryPoint {
public ReproduceColumnHiddenBugContainer() {
super(new BorderLayout());
BorderLayoutData centerData = new BorderLayoutData(Style.LayoutRegion.CENTER);
centerData.setMargins(new Margins(0));
add(new Grid<ModelData>(new ListStore<ModelData>(), new ColumnModel(createColumns())), centerData);
}

private List<ColumnConfig> createColumns() {
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
for (char c = 'A'; c < 'K'; c++) {
columns.add(new ColumnConfig(Character.toString(c), Character.toString(c), 100));
}
columns.get(columns.size() - 1).setHidden(true);
return columns;
}

@Override
public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FitLayout());
viewport.add(this);
RootLayoutPanel.get().add(viewport);
}
}

sven
1 Nov 2010, 10:46 AM
Fixed in SVN as of revision 2307