Results 1 to 3 of 3

Thread: set child component using real class name (not xtype)

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Answers
    13

    Default Answered: set child component using real class name (not xtype)

    is there a way to set a child component using the real class name instead of its xtype ?

    something like
    Code:
    Ext.define('somecomponent',
    {  extend : 'something'
        items: [
          {    xtype: 'form', <-- instead of this  
                class : 'Ext.form.Panel' <-- something like this
          }
        ]
    }

  2. You can use xclass:

    Code:
    new Ext.panel.Panel({
        renderTo : document.body,
        width    : 400,
        items    : [
            {
                xtype  : 'panel',
                frame  : true,
                height : 200,
                title  : 'xtype'
            },
            {
                xclass : 'Ext.panel.Panel',
                frame  : true,
                height : 200,
                title  : 'xclass'
            }
        ]
    });

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    You can use xclass:

    Code:
    new Ext.panel.Panel({
        renderTo : document.body,
        width    : 400,
        items    : [
            {
                xtype  : 'panel',
                frame  : true,
                height : 200,
                title  : 'xtype'
            },
            {
                xclass : 'Ext.panel.Panel',
                frame  : true,
                height : 200,
                title  : 'xclass'
            }
        ]
    });
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Answers
    13

    Default

    actually is not working, looking at the source code seems like xtype is the only way to do it,
    xclass is ignored.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •