Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since you already have a Panel that uses the contentEl to render HTML into its body, I recommend to stick with this approach: Replace the panel with an Ext.form.Panel instance - the configuration, particularly the contentEl config - can remain unchanged. </p> <p>The code provided here will override a standard Ext class (Ext.layout.Layout) and introduce support for a 'renderItemTo' config property on child items of any Ext container or panel instance (including Ext.form.Panel). The value of the config property should be the ID of an already rendered DOM node, e.g. a DIV element that is part of the HTML fragment used in as the contentEl of the parent container's body.</p> <pre><code>Ext.require(['Ext.layout.Layout'], function() { Ext.override(Ext.layout.Layout, { renderItem: function (item, target, position) { if(item.renderItemTo) { // render 'renderItemTo' components into the specified DOM element item.render(item.renderItemTo, 1); // don't allow container layout to seize the component item.layoutManagedHeight = 2; item.layoutManagedWidth = 2; } else { // just use standard Ext code for non-renderItemTo components this.callOverridden(arguments); } }, isValidParent: function(item, target, position) { // signal Ext that we are OK with were our 'renderItemTo' component is right now // otherwise it would get moved during the layout process return item.renderItemTo ? true : this.callOverridden(arguments); } }); }); </code></pre> <p>Usage:</p> <pre><code>var panel = Ext.create('Ext.form.Panel', { contentEl: 'form', // the DOM element ID that holds the HTML fragment for the body title: 'My FormPanel with special FX', items: [ { xtype: 'textfield', renderItemTo: 'text1', // the ID of a DOM element inside the HTML fragment fieldLabel: 'Label 1', }, { xtype: 'textfield', renderItemTo: 'text2', // the ID of a DOM element inside the HTML fragment fieldLabel: 'Label 2' } ] }); </code></pre> <p>I uploaded a <a href="http://jsfiddle.net/mistaecko/9KpBN/" rel="nofollow">working example</a> to JSFiddle (note: resize the window if you experience a render problem - this is related to JSFiddle, not my override).</p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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