Hello everybody,
I'm from the Flash world, and I'm really exited to improve my skills on Sencha !
I read a lot and watch many videos but I'm stuck at this point.
I have a view : Home.js where I create my class SimpleBlogContent, I pass a labelButton and an array
Code:
items : [
{
xclass : 'GS.view.SimpleBlogContent',
labelButton: 'Let\'s do it!!',
arrayPictures: [ '01.jpg', '02.jpg', '03.jpg' ]
}
],
Inside of my class SimpleBlogContent I want to achieve 2 things.
Code:
Ext.define('GS.view.SimpleBlogContent', {
extend: 'Ext.Container',
xtype: 'simpleblogContent',
config: {
labelButton : 'undefined',
arrayPictures: [],
constructor: function (config)
{
alert(this.getArrayPictures().length);
var configItemsArray = [];
for (var i=0; i< this.getArrayPictures().length; i++)
{
var buttonConfig = {
xtype: 'button',
text: this.getArrayPictures()[i]
};
configItemsArray.push(buttonConfig);
}
config.items = configItemsArray;
this.callParent(arguments);
},
items : [
{
xtype : 'button',
id : 'validButton',
ui : 'confirm',
name : 'boutonvalid',
text : 'I dont want this label but the dynamic',
handler : function(){
alert(this.parent.getArrayPictures());
}
}
]
}
});
I have a button created in items [] and I want to set the text with the config variable labelButton.
I want also create few buttons dynamically based on the array, I'm trying to do it inside of the constructor as I saw in some board, but it's not working, I have only the button created in items[]
Thank you so much for your help !
Ocelyn