geekflyer
30 Nov 2011, 6:26 PM
Hi guys i found a Problem with the centered config of an Ext.Container.
I'm using an Container with Cardlayout, which regularly should only show one the cards. However, in one card, which is also an Container, i did set the config centered to true, so that the contents of that card are relatively in the middle of he Page (i use it for an login page).
However this causes the specific card to never dissapear, instead it overlays one of the other cards. With other cards i mean the card, which i want to be active after pressing the login button. So there are 2 cards shown parallely, mixing up in a mess
Do you have another idea of centering ui controls in the View?
Here's part of my code, this the View, where i define the Container with the CardLayout and it's initial items:
/**
* Created by JetBrains WebStorm.
* User: geekflyer
* Date: 30.11.11
* Time: 15:23
* To change this template use File | Settings | File Templates.
*/
Ext.define('NeqMobile.view.Workspace', {
extend:'Ext.Panel',
requires:['NeqMobile.view.login.LoginForm'],
alias: 'widget.workspace',
config: {
layout: {
type: 'card',
animation: {
type: 'slide',
direction: 'left'
}
},
items: [
{
xtype:'loginform'
}
,
{
html: 'This here you can see in parellel, with the loginform, which is a bug.'
},
{
html: 'This here you cannot see at the beginning, but after activating the item, it would also show up in parallel with the loginform.'
}
]
}}
);
This is the Container / Card, with the centered : true config, which causes it to be always visible (overlays the other), even when another card is activated.
/**
* @author geekflyer
*/
Ext.define('NeqMobile.view.login.LoginForm', {
extend:'Ext.Container',
// requires:'NeqMobile.store.Users',
alias:'widget.loginform',
// this causes the bug, if i remove it, it works like a charm, except that the items in the Container are not centered.
centered: true,
config:{
centered: true, // this causes the bug too, no difference at all
items:[{
xtype:'fieldset',
title:'Login',
width:400,
instructions:'Enter your credentials',
items:[
{
xtype:'textfield',
label:'Name',
name:'name'
},
{
xtype:'passwordfield',
label:'Password',
name:'password'
},
{
xtype:'selectfield',
label:'Server',
name:'server',
options:[
{ text:'First Server ', value:'first' },
{ text:'Second Server', value:'second' }
]
}
,
{
xtype:'button',
ui:'confirm',
text:'Login',
width:400
}
]
},
{
xtype: 'button',
ui :'action',
id: 'settingsButton',
text:'Settings',
width:200}
]
}
});
I'm using an Container with Cardlayout, which regularly should only show one the cards. However, in one card, which is also an Container, i did set the config centered to true, so that the contents of that card are relatively in the middle of he Page (i use it for an login page).
However this causes the specific card to never dissapear, instead it overlays one of the other cards. With other cards i mean the card, which i want to be active after pressing the login button. So there are 2 cards shown parallely, mixing up in a mess
Do you have another idea of centering ui controls in the View?
Here's part of my code, this the View, where i define the Container with the CardLayout and it's initial items:
/**
* Created by JetBrains WebStorm.
* User: geekflyer
* Date: 30.11.11
* Time: 15:23
* To change this template use File | Settings | File Templates.
*/
Ext.define('NeqMobile.view.Workspace', {
extend:'Ext.Panel',
requires:['NeqMobile.view.login.LoginForm'],
alias: 'widget.workspace',
config: {
layout: {
type: 'card',
animation: {
type: 'slide',
direction: 'left'
}
},
items: [
{
xtype:'loginform'
}
,
{
html: 'This here you can see in parellel, with the loginform, which is a bug.'
},
{
html: 'This here you cannot see at the beginning, but after activating the item, it would also show up in parallel with the loginform.'
}
]
}}
);
This is the Container / Card, with the centered : true config, which causes it to be always visible (overlays the other), even when another card is activated.
/**
* @author geekflyer
*/
Ext.define('NeqMobile.view.login.LoginForm', {
extend:'Ext.Container',
// requires:'NeqMobile.store.Users',
alias:'widget.loginform',
// this causes the bug, if i remove it, it works like a charm, except that the items in the Container are not centered.
centered: true,
config:{
centered: true, // this causes the bug too, no difference at all
items:[{
xtype:'fieldset',
title:'Login',
width:400,
instructions:'Enter your credentials',
items:[
{
xtype:'textfield',
label:'Name',
name:'name'
},
{
xtype:'passwordfield',
label:'Password',
name:'password'
},
{
xtype:'selectfield',
label:'Server',
name:'server',
options:[
{ text:'First Server ', value:'first' },
{ text:'Second Server', value:'second' }
]
}
,
{
xtype:'button',
ui:'confirm',
text:'Login',
width:400
}
]
},
{
xtype: 'button',
ui :'action',
id: 'settingsButton',
text:'Settings',
width:200}
]
}
});