PDA

View Full Version : Problem with columns



mindler
26 Sep 2011, 5:24 AM
Hi,

I have a problem with columns in grid. In this grid there are 31 + 3 column with fix widths. And if I zoom out the view than I find that the columns in the grid-rows will be smaller than in the header. If I zoom out one more and more a difference will be 2 columns!

Does anybody know this problem? And the solution?

mankz
26 Sep 2011, 6:27 AM
Likely a known grid bug, but post your code in a runnable test case along with Ext JS version and browser version.

mindler
26 Sep 2011, 6:41 AM
Well, "runable" will be hard because of this part of my code is a part of a big project...

But here is the problematic code: --------------------------------------------

public HaviNyilvantartasTabPanel(String name, BindingManager bindingMgr, Enum tabEnumConstant) {
super(name);
this.enabled = AuthClient.getInstance().isIntezmeny();
this.buttonEnabled = false;
this.bindingManager = bindingMgr;
this.honap = 6;
this.ev = 2010;
this.setWidth("100%");

final ContentPanel wrapperPanel = new ContentPanel();
wrapperPanel.setButtonAlign(HorizontalAlignment.LEFT);
wrapperPanel.setHeaderVisible(false);
wrapperPanel.setBorders(false);
wrapperPanel.setWidth("100%");
wrapperPanel.setHeight("15px");

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig(1, "nev", 120);
column.setMenuDisabled(true);
configs.add(column);

CheckColumnConfig checkColumn = null;

DateWrapper dateWrapper = new DateWrapper(this.ev, honap, 1);

int maxDateOfmonth = dateWrapper.getLastDateOfMonth().getDate();
if (maxDateOfmonth == 28) {
maxDateOfmonth = 29;
}

for (int d = 0; d < maxDateOfmonth; ++d) {
checkColumn = new CheckColumnConfig(d + 1, ((Integer) (d + 1)).toString(), 23);
CheckBox cb = new CheckBox();
cb.setReadOnly(!this.enabled);
CellEditor checkBoxEditor = new CellEditor(cb);
checkColumn.setEditor(checkBoxEditor);
checkColumn.setSortable(false);
checkColumn.setMenuDisabled(true);
checkColumn.setAlignment(HorizontalAlignment.CENTER);
configs.add(checkColumn);
}

ColumnModel cm = new ColumnModel(configs);
this.bindingManager.getStore().setMonitorChanges(true);
this.bindingManager.getStore().setFiresEvents(true);
this.grid = new EditorGrid<BeanModel>(this.bindingManager.getStore(), cm);
this.grid.getView().setEmptyText("Nincsenek megjeleníthető jogosítók");
this.grid.setColumnLines(true);
this.grid.setBorders(false);

if (this.enabled) {
this.grid.addListener(Events.OnClick, this.columnHeaderListener);
this.grid.addListener(Events.BeforeEdit, new JogviszonyHatalyListener());
});
} else {
for (ColumnConfig col : configs) {
col.setStyle(Constants.BACKGROUND + ":" + Constants.ACCESSDENIED_STLYE + ";");
}
}
this.toolBar = new PagingToolBar(AbstractNapiNyilvantartasokBasePage.getGridPageSize());
PagingLoader<PagingLoadResult<?>> loader = (PagingLoader) this.bindingManager.getPagingLoader();
loader.setRemoteSort(true);
this.bindingManager.enableModificationCheckBeforeLoad();
this.toolBar.bind(loader);

this.toolBar.disableEvents(true);
ContentPanel mainPanel = new ContentPanel(new BorderLayout());
mainPanel.add(wrapperPanel, new BorderLayoutData(LayoutRegion.NORTH, 38));
mainPanel.add(this.grid, new BorderLayoutData(LayoutRegion.CENTER));
mainPanel.add(this.toolBar, new BorderLayoutData(LayoutRegion.SOUTH, 27));
mainPanel.setHeaderVisible(false);
this.add(mainPanel);
}
//---------------------------------------------------------

mankz
27 Sep 2011, 8:42 AM
Is this GXT code? Then you should post in the Ext GWT forum http://www.sencha.com/forum/forumdisplay.php?88-Gxt-Q-amp-A

mindler
28 Sep 2011, 3:21 AM
@mankz: Thank you for the moving.