Any idea why the docked items not displayed in the preview? Here is the code.
Ext.setup({
onReady:function(){
var top_toolbar= [{
xtype:'toolbar',
ui:'dark',
dock:'top',
title:'Login Form'
}]
var loginForm = new Ext.form.FormPanel({
items:[{
xtype:'fieldset',
items:[{
xtype:'textfield',
label:'Username',
name:'u_name',
labelWidth:100
},{
xtype:'passwordfield',
label:'Password',
name:'u_password',
labelWidth:100
}]
}]
});
var formPanel=new Ext.Panel({
fullscreen:'true',
layout:'fit',
dockedItems:top_toolbar,
items:[loginForm]
});
}
});
I am just trying to create a login page, with the textfields for username and password and need to include the toolbar docked on top which has the title ‘Login Form’. In the preview i get the textfields with label but it does not show the toolbar. am I doing anything wrong with the code?
Any help would be appreciated. Thanks in advance.
The
dockedItemsconfiguration has been deprecated in Sencha Touch 2. If you are using a version of the framework which does not include the compatibility layer, that configuration will not work.Instead, put all items, including docked items, inside the
itemsarray.Some other notes:
dockhas been changed todockedExt.form.FormPanelhas changed toExt.form.PanelExt.create()instead of the thenewkeyword. This means you can take advantage of Ext.Loader and dependency management. You can find our more information about it here: http://docs.sencha.com/touch/2-0/#!/guide/class_systemAnd finally, here is how your code should look if you implement all these changes:
Hope this helps.