View Full Version : ux.center

10 Nov 2010, 6:11 AM
I am desperate for a FULL sample, preferably a downloaded zip to show how to use this layout. I just want to center a panel, 500x500 in my browser. It seems there are pieces here and there but I can't seem to make anything work. Yes I DID see Center Custom Layout at http://dev.sencha.com/deploy/dev/examples/layout-browser/layout-browser.html but I couldn't make it work. Can anyone help? It shouldn't be this difficult to make it work yet I can't.


10 Nov 2010, 6:51 AM
I would use vbox instead of ux.center, e.g.

new Ext.Viewport({
layout: {
type: 'vbox',
pack: 'center',
align: 'center'
items: {
title: 'Hello World!',
frame: true,
width: 500,
height: 500

10 Nov 2010, 7:12 AM
I think ux.center can only center horizontally. Condor solution would be the best.

10 Nov 2010, 7:25 AM
No, ux.center can center both horizontally and vertically, but it does have some quirks (CenterLayout.css can affect nested panels).

ps. Or did you forget to include CenterLayout.css when you tested CenterLayout.js?

11 Nov 2010, 11:31 AM
MANY thanks