Hi
I've searched the forum and the bugtracker, found nothing concerning
this, so I report this bug. Sorry if it's already reported somewhere..
When a qx.ui.Table is positioned near the right border of a the screen,
the "columnVisibilityMenu" is wrongly positionned the first time that
the button is clicked : it's getting out of the screen. The next times
it's clicked, everything is ok, it is repositionned on it's right so
that it is indeed inside the screen. To reproduce, just run the first
qx.ui.Table demo in the demo browser, and make the window full screen
before clicking on the columnVisilibity button for the first time, then
click.
In my opinion, it's a qx.ui.menu.Menu issue, because the placeToWidget()
method is called at a time where either getBounds() on this menu widget
will return null (not yet in the DOM ) or it will return (0,0,2,2), thus
the menu items are not yet added. The "smart" positionning is computing
with a very small container, and is not seeing that it will go out of sight.
What i would suggest :
1/ Without patching qooxdoo, which my solution, listen to the
columnVisibilityMenuCreateEnd event of the table
myTable.addListener("columnVisibilityMenuCreateEnd",
function(menuCreateDataEvent){
var menu = menuCreateDataEvent.getData().menu;
new qx.util.DeferredCall(function(){
this.placeToWidget(this.getOpener());
}, menu).schedule();
});
2/ Changing the qx.ui.menu.Menu.open() method
open : function(){
if (this.getOpener() != null)
{
this.placeToWidget(this.getOpener());
this.show();
// Reschedule positioning if it's the first time
if(this.getBounds()== null){
new qx.util.DeferredCall(function(){
this.placeToWidget(this.getOpener());
}, this).schedule();
}
} else {
this.warn("The menu instance needs a configured 'opener' widget!");
}
}
The strange thing is that this "smart" behaviour seem to work on a Menu
placed on a qx.ui.toolbar.MenuButton aligned to the right of the toolbar.
Hope this helps someone
Charles
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel