PDA

View Full Version : Using dots in alias or prefix to use shorthand in controller



redmagic
20 Dec 2011, 5:12 AM
Hi,

I've been using aliases in my code to use xtypes in my views.
To help keep things organized, I've used an extra dot in the alias.


Ext.define('Importer.view.mmbase.UserControls', {
extend: 'Ext.Container',
alias: 'widget.mmbase.controls',


Is used like this:


this.items = [{
width: 300,
cls: 'left',
xtype: 'mmbase.controls'

Which works. However I would like to use it in the Controller as well, like this:


init: function () {
this.control({
'mmbase.controls button' : {
click: this.onButtonClick
}
});
},

Here it won't work. Is there another prefix I need to use instead of widget or are dots simply not allowed?

Kind regards,

Arjen

mitchellsimoens
20 Dec 2011, 5:25 AM
Having xtypes with periods in them will break ComponentQuery. You need to use a different naming convention like dashes or underscore.