PDA

View Full Version : EXT JS - Ext.util.Observable() - event names



rajuarien
9 Oct 2013, 5:44 AM
Do the event names in the fireEvent (http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.util.Observable-method-fireEvent)( eventName, args) in the Ext.util.Observable() need to be unique ?

Scenario : If we have multiple tabs using the same combo definitions(State, City) and individual tabs create the combo instances but fire the same Events since they relate to the same domain.
E.g. can we fire the stateChanged from both the tabs would each interfere with each other. If Tab 1 has a state changed it should not fire a cityLoad event in the second tab.
fireEvent('stateChanged', ...)
fireEvent('cityLoad'...)

israelroldan
14 Oct 2013, 1:36 PM
Yes, the event names should be unique. The point of fireEvent is to have a way to call an event at anytime and pass it the correct arguments, so you should avoid the double call inside the method's body.