Results 1 to 4 of 4

Thread: Ref not working for components in composite field

  1. #1

    Default Ref not working for components in composite field

    I thought I should be able to use the 'ref' attribute for components within a composite field.

    IE I think this should work any one have any ideas:

    Code:
    var f = new Ext.form.FormPanel({
         renderTo:'test'
        ,width:400
        ,height:300
        ,title:'testing'
        ,items:[{
             xtype:'compositefield'
            ,fieldLabel:'Composite'
            ,items:[{
                 xtype:'textfield'
                ,name:'text'
                ,ref:'../textField'
            },{
                 xtype:'button'
                ,text:'Test'
                ,ref:'../btnTest'
            }]
        }]
    });
    console.log(f.textField, f.btnTest);
    I have tried adding more '../' with no luck. Try the example for yourself. Should this work??????

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895

    Default

    It seems broken for me as well...

  3. #3

    Default

    Anyone have any ideas?

    Again I am running 3.2.1.

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791

    Default

    It doesn't work in 3.2.1 but it does work in 3.3.1 and 3.4.0.

    Seems to be this bit of code that does it:

    http://dev.sencha.com/deploy/ext-3.4...Field-defaults

    ref works by following the ownerCt chain. A composite field isn't a container so it doesn't add ownerCt to its items and as a result ref won't work automatically. In 3.4.0 this is worked around by wrapping the items in an extra container within the composite field and faking the ownerCt on the container to point to the composite field. All the refs have an extra '../' added to them to make this work the way you'd expect.

Similar Threads

  1. bug in composite field
    By ridasfa1 in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 27 Feb 2011, 11:52 AM
  2. Composite field is not working
    By sachin sachdeva in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 28 Jan 2011, 4:35 AM
  3. Composite fields not working in extjs 3.1
    By sachin sachdeva in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 28 Jan 2011, 2:58 AM
  4. Composite Field
    By mhuibers in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 25 Feb 2008, 4:37 AM

Posting Permissions

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