PDA

View Full Version : Is it possible to pass custom parameters along with the defaults of a listener?



hermann.s
27 Aug 2013, 2:54 AM
Hi,

I have a listener that I declare like this :


SidePanel.current.addListener('itemclick', 'loadContainer');

This is what loadContainer looks like.


loadContainer : function(view, record, item)
{


if (record.get('id') == "@BFE.Frontend.Main.CurrentTasksNode")
{
ContainerList.current = ContainerList.taskContainer;
}
else if (record.get('id') == "@BFE.Frontend.Main.SearchNode")
{
ContainerList.current = ContainerList.searchContainer;
}
else if (record.get('id') == "@BFE.Frontend.Main.DelegationNode")
{
WindowList.current = WindowList.delegationContainer;
}


MainPanel.current.getLayout().setActiveItem(ContainerList.current.getId());
}


Is it possible to pass my own parameters but also keep the view, record, item parameters as well? How does that work?

evant
27 Aug 2013, 3:08 AM
Check out Ext.Function.bind.