Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To load a view, you can use <code>Ext.widget()</code>. Use <code>Ext.define()</code> to create a view in your view file. I would recommend using the <code>alias</code> property to define an inline xtype for the view.</p> <p>When you need to load the view, you create an view using <code>Ext.widget()</code> and specify the xtype (alias for your view). Here is an example:</p> <pre><code> // define a window Ext.define('MyApp.view.user.Add', extend: 'Ext.window.Window', alias : 'widget.adduser', . . // Add other properties, custom properties, methods, event handlers etc.. }); </code></pre> <p>Now, when you want to create an instance in your user controller, you do:</p> <pre><code>// create an instance var view = Ext.widget('adduser'); // refer the below note! </code></pre> <p><strong>Note:</strong> note that there is no 'widget.'! it automatically gets added to the widget name you pass.</p> <p>Now, taking about passing parameters. Like Ext.create method, you should be able to pass any parameters as:</p> <pre><code> // create an instance with params var view = Ext.widget('adduser', {title: 'New User title'}); </code></pre> <p><strong>Regarding ref</strong>: refs help you in getting references to Views on your page. They do not help in creating an instance or load a view. If you have your view rendered, you can make use of the ref system to get hold of that instance and manipulate the view. You need to make use of the <a href="http://dev.sencha.com/deploy/ext-4.0.0/docs/api/Ext.ComponentQuery.html">ComponentQuery</a> to get reference of your view. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload