Results 1 to 2 of 2

Thread: Same linked instances looking different

    You found a bug! We've classified it as DSGNR-2051 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    17
    Vote Rating
    0
      0  

    Default Same linked instances looking different

    Architect Build tested:
    • Build: 442

    Project Type:
    • ExtJS 4.x

    Description:
    • I have a FieldContainer with two numeric fields, configured to hide triggers.
      When creating two linked instances of this FieldContainer, one looks ok and the other
      shows the triggers.

    Steps to reproduce the problem:
    • Create FieldContainer
    • Add two instances of the FieldContainer to the same panel. Looks good on the design window.
    • Preview it in the browser.

    The result that was expected:

    PhonesOK.png


    The result that occurs instead:

    PhonesNOK.png

    Operating System:
    • Windows 7 Professional

    Related Code:

    Code:
    Ext.define('PBAS.view.PhoneFields', {
        extend: 'Ext.form.FieldContainer',
        alias: 'widget.phonefields',
    
        height: 65,
        width: 292,
        layout: {
            padding: 5,
            type: 'hbox'
        },
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'numberfield',
                        id: 'phoneField',
                        padding: 5,
                        width: 185,
                        fieldLabel: 'Number',
                        labelWidth: 40,
                        enforceMaxLength: true,
                        maxLength: 10,
                        hideTrigger: true,
                        repeatTriggerClick: false,
                        keyNavEnabled: false,
                        mouseWheelEnabled: false,
                        spinDownEnabled: false,
                        spinUpEnabled: false,
                        allowDecimals: false,
                        autoStripChars: true
                    },
                    {
                        xtype: 'numberfield',
                        id: 'extField',
                        padding: 5,
                        width: 80,
                        fieldLabel: 'Ext',
                        labelWidth: 20,
                        enforceMaxLength: true,
                        maxLength: 4,
                        hideTrigger: true,
                        repeatTriggerClick: false,
                        keyNavEnabled: false,
                        mouseWheelEnabled: false,
                        spinDownEnabled: false,
                        spinUpEnabled: false,
                        allowDecimals: false
                    }
                ]
            });
    
            me.callParent(arguments);
        }
    
    });

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    You cannot use an 'id' in a component that will have multiple instances.

    id's are global. Since you have put it into the child you cannot use this component more than once.

    You should use itemId's when your identifiers need to be unique to a component/container.
    Aaron Conran
    @aconran

Posting Permissions

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