blancomario
12 May 2010, 11:40 AM
I am trying to setup a combobox and a treepanel to talk to each other via events. When a selection is made in the combobox the combobox will throw and event than the treepanel will listen to this event a do so stuff. However, I just can't get it to work. What am I missing?
Below is a small piece of code of that illustrates what I am trying to do
myCombo = Ext.extend(Ext.form.ComboBox({
initComponent: function(){
myCombo.superclass.initComponent.apply(this,arguments);
this.addEvents("listchanged");
this.on("select", function(combo, record, index){
this.fireEvent("listchanged", record);
}
}
});
myTree = Ext.extend(Ext.tree.TreePanel({
initComponent: function(){
myTree.superclass.initComponent.apply(this,arguments);
this.on("listchanged", function(record){
//do some stuff
});
}
});
Thanks!!!
Below is a small piece of code of that illustrates what I am trying to do
myCombo = Ext.extend(Ext.form.ComboBox({
initComponent: function(){
myCombo.superclass.initComponent.apply(this,arguments);
this.addEvents("listchanged");
this.on("select", function(combo, record, index){
this.fireEvent("listchanged", record);
}
}
});
myTree = Ext.extend(Ext.tree.TreePanel({
initComponent: function(){
myTree.superclass.initComponent.apply(this,arguments);
this.on("listchanged", function(record){
//do some stuff
});
}
});
Thanks!!!