PDA

View Full Version : button identifies parent when pressed



clabasky
13 Sep 2011, 11:54 AM
helllllo everyone!

I'm trying to create many instances of a lazily instantiated panel, which will display data and have a "completed" button which will remove the specific panel that the button is on. Each panel is basically a copy of the others, but with different data displayed, I need a way to identify the parent component (newpanel) of the button so that I can destroy it with the "completefavor" action handler



var newpanel =
{
xtype: 'panel',
tpl: favorXTemplate,
items: [
{
xtype: 'toolbar',
title: 'active favor',
items: [
{
text: 'completed!',
handler: function() {
Ext.dispatch({
controller: 'controller',
action: 'completefavor'
});
}
}
]
}
]
};


any suggestions as to how I can accomplish this?
or other ideas? :-?
thanks!!!