-
17 Nov 2012 5:37 PM #1
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); } } } ] } ] }); } });
-
17 Nov 2012 7:18 PM #2
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
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 codeCode:this.up('formpanel')......
-
19 Nov 2012 11:04 AM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
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.
This issue duplicates another issue.


Reply With Quote