I'm trying to navigate the Sencha class system, and seem to be failing in this aspect.
I have a Carousel that I'm adding Components too. I have a Store with records, and I'm looping through the records and adding a custom Component to the Carousel in each iteration. Here's the code for that...
var carousel = Ext.create("Ext.Carousel", {
fullscreen: true
});
sights.each(function(sight, index, length){
carousel.add(Ext.create("Parks.view.ImageView", {
imageName: sight.get("img"),
titleName: sight.get("name")
}));
});
My custom Component has the following code, but is failing to execute because of the getImageName() function. It's complaining it's not defined. But, based on my understanding of the Sencha class structure, it should have been defined by the constructor on initialization?
Ext.define("Parks.view.ImageView", {
extend: "Ext.Panel",
fullscreen: true,
config: {
imageName: "",
titleName: ""
},
constructor: function(config){
this.initConfig(config);
},
items: [
{
xtype: "img",
layout: "fit",
src: getImageName()
}
]
});