Results 1 to 3 of 3

Thread: Ext.define Component create & xtype ?

  1. #1
    Sencha User
    Join Date
    Sep 2014
    Posts
    2

    Default Ext.define Component create & xtype ?

    Extjs Version: 4.2.1

    Code:
            Ext.define('My.Window',{
                   extend:'Ext.window.Window',
                   items: [
                      Ext.create('Ext.form.field.Text',{value: 'create'}),
                      {
                          xtype: 'textfield',
                          value: 'xtype'
                      }
                   ]
                });
    
    
                new My.Window({title:'1'}).show();
                new My.Window({title:'2'}).show();
    Run:
    bug2.jpg
    Attached Images Attached Images

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Should be something like there where you use create on the instance of the class:

    Code:
    Ext.define('My.Window', {
        extend: 'Ext.window.Window',
        items: [{
            xtype: 'textfield',
            value: 'xtype'
        }, {
            xtype: 'textfield',
            value: 'xtype'
        }]
    });
    
    Ext.define('My.Window2', {
        extend: 'Ext.window.Window',
        
        initComponent: function() { // on instance
            Ext.apply(this, {
                items : [
                    Ext.create('Ext.form.field.Text',{value: 'create'}),
                    Ext.create('Ext.form.field.Text',{value: 'create'})
                ]
            });
            this.callParent(arguments);
        }    
        
    });
    
    
    new My.Window({
        title: '1'
    }).show();
    
    new My.Window({
        title: '2'
    }).show();
    
    new My.Window2({
        title: '1'
    }).show();
    
    new My.Window2({
        title: '2'
    }).show();

  3. #3
    Sencha User
    Join Date
    Sep 2014
    Posts
    2

    Default

    thanks !

Tags for this Thread

Posting Permissions

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