Note that there are some explanatory texts on larger screens.

plurals
  1. POExt Window with custom template
    primarykey
    data
    text
    <p>I'd like to create a popup window, that'll have some custom template. The basic functionality is to have some text in header, then form, progressbar and buttons. Problem is that my custom template is rendered at the very end and doesn't really fit in the popup. What is the proper approach for this ? Any examples available anywhere ? My shortened code :</p> <pre><code>Ext.define('MyTooltip', { extend : 'Ext.window.Window', title: 'Mywindow', closeAction: 'hide', width: 300, height: 300, layout: 'fit', resizable: false, draggable: true, modal: true, items: [], data: { bar: 'foo' }, tpl : Ext.create('Ext.XTemplate', '&lt;div class="tooltip"&gt;&lt;h1&gt;{bar}&lt;/h1&gt;&lt;div&gt;{form}&lt;/div&gt;&lt;/div&gt;', {compiled: true}), initComponent: function(){ var me = this; //Create items var progressBar = Ext.create('Ext.ProgressBar', { text: 'Progress...', width: 250, animate: true, hidden: true, id: 'widget-progressbar' }); me.items = [ Ext.create('Ext.form.Panel',{ layout: { type: 'vbox', align: 'stretch' }, border: false, bodyPadding: 10, fieldDefaults: { labelAlign: 'top', labelWidth: 100, labelStyle: 'font-weight:bold' }, items: [ { width: 50, xtype: 'combo', mode: 'local', value: 'Audi', triggerAction: 'all', forceSelection: true, editable: false, fieldLabel: 'Cars', name: 'cars', queryMode: 'local', store: ["Audi", "BMW", "Citroen"] }, progressBar ], buttons: [ { text: 'Start', handler: function() { }, scope: this } ] }) ] me.callParent(arguments); } }); </code></pre> <hr> <p>EDIT</p> <p>Following first answer tried to change my initComponent method, but how can I get my items rendered into tpl, or html ?</p> <pre><code>initComponent: function(){ (...) me.callParent(arguments); var tpl = Ext.create('Ext.XTemplate', '&lt;div&gt;'+ '&lt;div&gt;&lt;h3&gt;Available cars&lt;/h3&gt;'+ '&lt;div&gt;{form}'+ '&lt;/div&gt;'+ '&lt;/div&gt;', {compiled: true} ); this.html = tpl.apply({ form: me.form.html }); }, </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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