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
    Vote Rating
    10
      0  

    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,381
    Answers
    3997
    Vote Rating
    1527
      0  

    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
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

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

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Answers
    13
    Vote Rating
    10
      0  

    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
  •