-
24 Dec 2011 8:41 AM #1
autoEl Array Problem
autoEl Array Problem
A backwards-compatibility issue I ran into. My code was wrong but it might help someone else...
I had something like this and it worked fine in 4.0.7:
Doing the same with 4.1.0-beta-1 generates some totally nonsense HTML.Code:Ext.create('Ext.Component', { renderTo: Ext.getBody(), autoEl: [{ cn: [{}, {}, {}, {}] }] });
The mistake is that my autoEl is an array. Get rid of the brackets and it works fine.
-
24 Dec 2011 9:00 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
Bad skirtle! Docs do say String/Object
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.
-
24 Dec 2011 9:15 AM #3
Chastise away. I hate it when I make mistakes. I intend to spend my evening self-flagellating as a penitence. It's the only way I'll learn...
-
24 Dec 2011 9:20 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
I will tease you
I've made my fair share and then 100 other's share of mistakes. I'm just having some fun with you
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.
-
5 Jan 2012 1:27 AM #5
And what about that ?
Works fine in 4.0.7:
In 4.1 beta it gives me :Code:this.autoEl = { tag: 'span', cls: this.cls // set the css class }
In 4.0.7 :Code:<span cls style=" ....
Code:<span class="myclass" style="...
-
5 Jan 2012 1:37 AM #6
It seems to work better like this:
My app is still not availble with this release. Lot of fix to done.this.autoEl = { tag: 'span' }
-
5 Jan 2012 2:43 AM #7
I had a play with this. I could only get it to go wrong if I set cls to null:
For other values, including undefined, it works as expected. Are you able to produce a test case to reproduce what you've observed with a non-null value?Code:Ext.create('Ext.Component', { renderTo: Ext.getBody(), autoEl: { cls: null, tag: 'span' } });
What worries me more is that if I do this:
ExtJS 4.0.7 gives me this:Code:Ext.create('Ext.Component', { renderTo: Ext.getBody(), autoEl: { cls: 'myclass', tag: 'span' } });
whereas 4.1.0-beta-1 gives me this:Code:<span class="myclass x-component x-component-default" id="component-1014" role="presentation"></span>
Code:<span id="component-1014" class="myclass"></span>
-
5 Jan 2012 3:02 AM #8
Im my case there was a cls property in my component:
Code:Ext.create('Ext.Component', { renderTo: Ext.getBody(), cls: 'myclass', constructor: function(config) { ... autoEl = { cls: this.class, tag: 'span' } ... } });
-
5 Jan 2012 3:08 AM #9
Could you give a complete test case? Some JS I can drop into an HTML page and see the problem?


Reply With Quote