문제

Given the following configuration to an Ext JS combo box:

{
    xtype: 'combobox',
    width: 350,
    store: 'price.Book', 
     name: 'books'
}

I want to listen for the change event on the combobox and alert it's name.

change: function(combo) {
    var dateObj777= Ext.ClassManager.getName('books');
    alert(dateObj777.name);
}

"undefined" is alerted when i'm expecting the name.

도움이 되었습니까?

해결책

Perhaps you need to use the itemId property in conjunction with Ext.ComponentQuery.query(), something like

 {
    xtype: 'combobox',
    width: 350,
    store: 'price.Book', 
    name: 'books',
    itemId: 'booksCombo'
}

...

change: function(thisCombo) {
    var otherCombo = Ext.ComponentQuery.query('#booksCombo')[0];
    alert(otherCombo.name);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top