PDA

View Full Version : [CLOSED] Application do not get other attributes of the list



fabio.policeno
10 Nov 2011, 2:13 PM
Hello, I have my list set:


Ext.define('Touch.view.cliente.List' ,{
extend : 'Ext.List',
alias : 'widget.clientelist',
itemTpl: '{id} {nome}',
store : 'Cliente'
});


By using the application, nothing appears on the screen, no error on the console:


Ext.Loader.setConfig({
enabled: true
});

Ext.application({
name : 'Touch',
appFolder : 'view',
controllers: ['Cliente'],

launch: function() {
Ext.create('Touch.view.cliente.List');
}
});


But it turns out it works:


Ext.Loader.setConfig({
enabled: true
});

Ext.application({
name : 'Touch',
appFolder : 'view',
controllers: ['Cliente'],

launch: function() {
Ext.create('Touch.view.cliente.List', {
fullscreen: true,
itemTpl : '{id} {nome}',
store : 'Cliente',
});
}
});



That is, it includes the class, recognize your name / alias, but does not accept the other properties defined in the list, only if you set that works directly on the launch.

AndreaCammarata
11 Nov 2011, 4:29 AM
Hi Fabio.
This is not a bug.
In Sencha Touch 2 you should include all the additional components configuration inside the Config object like follows:



Ext.define('Touch.view.cliente.List' ,{
extend : 'Ext.List',
alias : 'widget.clientelist',
config: {
fullscreen: true,
itemTpl: '{id} {nome}',
store: 'Cliente'
}
});


Hope this helps.

fabio.policeno
11 Nov 2011, 5:12 AM
Hm. Now yes. Thank you!