PDA

View Full Version : How do you render panel items



bkraut
21 Jun 2011, 3:25 PM
Hi,

I created a component which has several items. How can I render items in a specific position in component template. Here is the code of template:



Ext.ux.StoryBoardRow = Ext.extend(Ext.BoxComponent, {

tpl: new Ext.Template(
'{row}'
),

autoEl: {
tag: 'div',
cls: 'x-storyboard x-row'
},

initComponent: function() {

this.tpl.compile();

Ext.apply(this, {
autoHeight: true
});

Ext.ux.StoryBoardRow.superclass.initComponent.apply(this, arguments);

},

onRender:function(ct, position) {
Ext.ux.StoryBoardRow.superclass.onRender.call(this, ct, position);
// This part is not working
Ext.iterate(this.items, function(item) { // This part is not working
this.tpl.append(this.el, {
row: item
});
});
}

});

skirtle
23 Jun 2011, 3:47 AM
You're just missing the scope:


Ext.iterate(this.items, function(item) {
...
}, this);