sencha touch - Card layout does not admit a floating Panel -


i'm starting sencha touch , have small issue floating panel. idea create small login panel grant access aplication main panel. viewport panel card layout , 2 panels it, loginpanel , mainpanel.

my first approach create floating formpanel login form , insert in viewport, problem panel stretches out whole viewport instead of centered specified in properties. way following:

var app = new ext.application({     name: 'tool'     ,useloadmask: true     ,launch: function(){          tool.views.loginpanel = new ext.panel({             listeners: {                 afterrender: function(){                 //settimeout('loginform.show();', 2000);                 tool.views.loginform.show();                 }             }         });          tool.views.loginform = new ext.form.formpanel({                         floating: true                         ,width: 350                         ,height: 300                         ,centered: true                         ,modal: true                         ,hideonmasktap: false                         ,dockeditems:[{                             xtype: 'toolbar'                             ,title: 'identificación'                             ,ui: 'light'                             }],                         items: [{                             xtype: 'fieldset'                             ,id: 'loginformset'                             ,title: ''                             ,items: [                                 {                                     xtype: 'emailfield',                                     placeholder: 'usuario',                                     name: 'usuario',                                     id: 'username',                                     required: true,                                 }, {                                     xtype: 'passwordfield',                                     placeholder: 'password',                                     name: 'password',                                     required: true                                 }, {                                     xtype: 'checkboxfield',                                     id: 'rememberme',                                     name: 'rememberme',                                     label: '¿guardar id?',                                     labelwidth: '40%'                                 },{                                     xtype: 'button',                                     text: 'acceder',                                     ui: 'confirm',                                     style: 'margin:2%;',                             handler: function(){                                 mainpanel.setactiveitem(1);                                 loginform.destroy();                             }                                      }]                             }]                 });          tool.views.viewport = new ext.panel({             fullscreen: true             ,cls: 'mi_clase1'             ,layout: 'card'             ,cardanimation: 'slide'             ,items: [tool.views.loginpanel]          }) // fin del panel viewport     } // find de funcion ,launch }) // fin de la application 

as can see, loginform has inserted in panel, , panel in viewport card layout. if insert formpanel in viewport, doesn´t work. why this? doing wrong?, or maybe way way floating panel in card layout?

another question the: settimeout('loginform.show();', 2000);

it doesn´t work, , doesn´t display anything. idea?

thanks lot

part one - in general, sencha touch application should contain 1 fullscreen panel. called viewport , acts container other components. when create floating window without viewport, has no frame of reference in center itself.

part two - instead of:

settimeout('loginform.show();', 2000); 

try this:

settimeout('tool.views.loginform.show();', 2000); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -