В моем проекте я создал widget alias
для приведенного ниже кода в «Просмотре» как notifications
. Теперь, как получить доступ к каждому элементу в «Контроллере»?
extend: 'Ext.panel.Panel',
alias: 'widget.notifications',
layout: 'fit',
items:[{
xtype: 'container',
layout: {type: 'vbox', align: 'stretch'},
items: {
xtype: 'container',
flex:1,
layout: {type: 'vbox', align: 'stretch'},
items:[{
xtype: 'container',
flex: 1,
items: [{
xtype: 'container',
height: 20,
html: "This week",
},
{
xtype: 'container',
flex: 1,
layout: {type: 'vbox', align: 'stretch'},
items: [{
xtype: 'container',
height:20,
html : 'show submit status here'
},
{
xtype: 'container',
flex: 1,
}]
}]
},
{
xtype: 'container',
flex: 1,
layout: {type: 'vbox', align: 'stretch'},
items: [{
xtype: 'container',
height: 20,
html: "This month"
},
{
xtype: 'container',
flex: 1,
layout: {type: 'vbox', align: 'stretch'},
items: [{
xtype: 'container',
html: 'submit status of month here',
height: 20
},
{
xtype: 'container',
flex: 1,
}]
}]
}]
}
}]
Я старался:
var notificationView = Ext.widget('NotificationView');
var childItem = notificationView.items.items[0].items.items[0].items.items[0].items.items[0];
Что просто дает мне головную боль и много ошибок.
Я также пытался использовать ComponentQuery следующим образом:
var childItem = notificationView.ComponentQuery.query('container>container>container>container');
Который получает только первый дочерний элемент, а не другие дочерние элементы.