Question

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.

Was it helpful?

Solution

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);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top