Defining a Panel and instantiating it in a viewport <p>I am trying to get Ext.define &amp; Ext.create working in Sencha touch 2, so that I can define everything in my library and just create stuff pre-configured.</p> <p>However, Ext.define is not doing what I would expect it to in anything I've tried.</p> <p>Why does the following code not create a panel inside the viewport with the field label "Tame"? </p> <pre><code>Ext.define('mobi.form.Login',{ extend:'Ext.form.Panel', items: [{ xtype: 'textfield', name: 'Tame', label: 'Tame' } ] }); Ext.application({ viewport: { layout:'fit' }, launch: function(){ var form = Ext.create('Ext.form.Panel', { items: [{ xtype: 'textfield', name: 'name', label: 'Name' } ] }); Ext.Viewport.add(Ext.create('mobi.form.Login')); // This doesnt add anything to the viewport Ext.Viewport.add(form); //magically this works } }) </code></pre>