PDA

View Full Version : Problem with autoEl



anderson.resendes
6 Jan 2012, 4:30 AM
I´m with a problem in autoEl attribute, doing something like the example an error occurs. If I remove the ID, it works fine, but I need de ID. Why can I do it in this version?



{
width : 5,
xtype : 'box',
autoEl : {
tag : 'div',
cls : 'se-core-breadcrumb-left-img,
id : 'se-core-breadcrumb-left-img'
}
}

mitchellsimoens
6 Jan 2012, 11:07 AM
This is because the id of the top element has to match the id of the component. So this would work:



{
xtype : 'component',
width : 5,
id : 'se-core-breadcrumb-left-img',
autoEl : {
tag : 'div',
cls : 'se-core-breadcrumb-left-img',
id : 'se-core-breadcrumb-left-img'
}
}


But you then might as well just put the id on the component and not in autoEl.. or just not use id as it's a bad practice to get into unless you are debugging.

anderson.resendes
9 Jan 2012, 4:10 AM
Thanks!!!

One problema less :)