PDA

View Full Version : autoEl for a custom component renders all elements in 3.0, skips one in 3.1



js_coder
22 Dec 2009, 12:44 PM
This code in a custom component, that is extending Ext.Component, does not render the <a> in ExtJS 3.1. It does in 3.0:



autoEl: {
tag: 'li',
children: [{
tag: 'a',
href: 'javascript:;',
html: this.initialConfig.html
}]
}
Have I found a bug?

hendricd
22 Dec 2009, 3:51 PM
This code in a custom component, that is extending Ext.Component, does not render the <a> in ExtJS 3.1. It does in 3.0:



autoEl: {
tag: 'li',
children: [{
tag: 'a',
href: 'javascript:;',
html: this.initialConfig.html
}]
}
Have I found a bug?

Doubtful, but try this in your Firebug console:


new Ext.BoxComponent({
autoEl : {
tag: 'li',
children: [{
tag: 'a',
href: 'javascript:;',
html: 'test link'
}]
}
}).render(Ext.getBody());

Animal
23 Dec 2009, 12:42 AM
This code in a custom component, that is extending Ext.Component, does not render the <a> in ExtJS 3.1. It does in 3.0:



autoEl: {
tag: 'li',
children: [{
tag: 'a',
href: 'javascript:;',
html: this.initialConfig.html
}]
}
Have I found a bug?

The fact that you are using the html config is the problem. The html config specifies what html to put into the Component.

It's doing what you asked. Creating the element as described. And then putting the configured html into it.

js_coder
23 Dec 2009, 8:28 AM
Thanks, that makes sense, I didn't recognize the conflict before. I guess I was able to get away with it in 3.0 but no longer, so I'm passing in the link's text as a "text" property now.