antun
9 Oct 2012, 8:47 PM
I'm new to Sencha (using 4.1.1), so this is probably a very basic quesion. In the code example below, why is a a reference to the panel, and b undefined? Is there a different method I need to use to reference a nested object?
Ext.define('SFC.view.flashcard.Show' ,{
extend: 'Ext.container.Container',
alias : 'widget.flashcardshow',
layout: 'fit',
title : 'Flashcard TODO',
store: 'SpanishWords',
items : [
{
itemId: 'flashWord',
xtype: 'panel',
layout: 'hbox',
title: 'Spanish Flashcards',
items: [
{
xtype: 'text',
itemId: 'foobar',
text: 'palabra'
}
]
}
],
initComponent: function() {
this.callParent(arguments);
},
updateWord: function(newWord) {
// THIS WORKS:
var a = this.getComponent("flashWord");
console.log(a);
// THIS DOES NOT:
var b = this.ownerCt.getComponent("foobar");
console.log(b);
}
});
Thanks,
Antun
Ext.define('SFC.view.flashcard.Show' ,{
extend: 'Ext.container.Container',
alias : 'widget.flashcardshow',
layout: 'fit',
title : 'Flashcard TODO',
store: 'SpanishWords',
items : [
{
itemId: 'flashWord',
xtype: 'panel',
layout: 'hbox',
title: 'Spanish Flashcards',
items: [
{
xtype: 'text',
itemId: 'foobar',
text: 'palabra'
}
]
}
],
initComponent: function() {
this.callParent(arguments);
},
updateWord: function(newWord) {
// THIS WORKS:
var a = this.getComponent("flashWord");
console.log(a);
// THIS DOES NOT:
var b = this.ownerCt.getComponent("foobar");
console.log(b);
}
});
Thanks,
Antun