This issue duplicates another issue.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    130
    Vote Rating
    1
    stefankendall is an unknown quantity at this point

      0  

    Default xtype is set to 'element' for different elements, instead of the proper xtype.

    xtype is set to 'element' for different elements, instead of the proper xtype.


    I have a nested element. When I try to use the "up" method in the painted listener, I get null when querying for formpanel. When I use getParent() to climb the component chain, the formpanel (identified by its auto-generated id) has an xtype value of "element". I'm guessing this is why up is failing.

    This was working in 2.0.0.

    Code:
     Ext.application({
                launch:function () {
                    Ext.create('Ext.form.Panel', {
                        fullscreen:true,
                        items:[
                            {
                                xtype:'fieldset',
                                cls:'notes-form',
                                items:[
                                    {
                                        xtype:'textareafield',
                                        name:'notes',
                                        listeners:{
                                            painted:function (c) {
                                                var parentHeight = c.up('formpanel').element.getHeight(true);
                                                c.element.down('textarea').setHeight(parentHeight - 7);
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    });
                }
            });

  2. #2
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    345
    Vote Rating
    17
    suzuki1100nz will become famous soon enough suzuki1100nz will become famous soon enough

      0  

    Default


    Hi,

    Think your getting mixed up between component query and dom query.
    Your code is using a dom query (c is an Ext.Element) returning an Ext.dom.Element so is expecting css selectors see- http://docs.sencha.com/touch/2-1/#!/api/Ext.DomQuery


    To use a component query try
    Code:
    this.up('formpanel')......
    You could also set itemId on the panel and use that to find the panel, that way if you change the type it wont break your query code

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,636
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    There is currently a bug where the painted event, the first argument is the element not the component as it should be.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.