我有一個簡單的問題,即使它給了我相當頭痛的問題。在EXT JS中獲取現場容器的孩子4
我有一個已經添加到它的一些無線電場場容器:但是
xtype : 'fieldcontainer',
fieldLabel : 'Field type',
defaultType: 'radiofield',
defaults: {
flex: 1
},
items: [
{
boxLabel : 'Plain Text',
name : 'plain-text',
inputValue: 'plain-text',
id : 'plain-text'
}, {
boxLabel : 'Rich Text',
name : 'html-text',
inputValue: 'html-text',
id : 'html-text'
}, {
boxLabel : 'Time',
name : 'time',
inputValue: 'time',
id : 'time'
},
{
boxLabel : 'Typed reference',
name : 'typed-reference',
inputValue: 'typed-reference',
id : 'typed-reference'
},
{
boxLabel : 'Date',
name : 'date',
inputValue: 'date',
id : 'date'
}
],
listeners: {
added: function(radiofield) {
??
}
我幾乎嘗試了一切檢查radiofield對象,比如迭代其items.items陣列添加的項目,我只得到項目的整數值,而不是對象本身。我想迭代添加到容器的所有項目,以便在符合特定條件的無線電字段上設置選中的值。
我喜歡CD的答案,因爲實施起來很快。感謝您的意見! – Lasse