PDA

View Full Version : Size < 1 (for BorderLayoutData): Popup will be have incorrect position!



Vadim Kolesnikov
16 Feb 2012, 7:36 AM
- GXT version: 2.2.5
- Host mode / web mode / both: All
- Browser and version: All
- Operating System: Windows 7

public void setSize(float size)
The region's preferred size. Values of 1 or less are treated as percentages (defaults to 200).
Parameters:
size - the region size

But if size < 1 :

com.extjs.gxt.ui.client.widget.CollapsePanel



308 int w = 0;
309 int h = 0;
310
311 switch (region) {
312 case WEST:
313 case EAST:
314 w = (int) parentData.getSize(); // (float) size < 1 ~ (int) 0!
315 h = box.height - 25;
316 break;
317 case NORTH:
318 case SOUTH:
319 w = box.width;
320 h = (int) parentData.getSize(); // (float) size < 1 ~ (int) 0!
321 }
322
323 // needed to enforce correct sizing
324 panel.removeFromParent();
325 popup.setSize(w, h); // popup will be have incorrect position!
326 popup.show(getElement(), align, adj);
327 popup.add(panel);
328 popup.layout();
329
330 afterShowPanel(panel);
331 }