samedi 20 décembre 2014

Events from parent containers/controllers ....

I'm building a sample desktop application and I created a window with a childen panel, a toolbar with buttons to implement a menu. This window is opened several times and each window is totally independent.

The panel can be seen as a standalone component with a fixed set of commands/events it may react on.


Whenever a button (menu item) is pressed (in the window) I fire an event (via fireEvent) with my own defined application events - the problem I have: HOW do I define (within the Architect) the children panel (or its controller) do listen only for these domain events fired from within its parent hierarchy.


I used something like.


listen: {

controller: {

'*': {


}

}

}


but this simply fails if I open the window several times, because the panel would get the domain events from all opened windows.


All architecture is based on the ViewModel, ViewController principle. I use ExtJs 5.0.1 and Architect 3.1.0






Events from parent containers/controllers ....

Aucun commentaire:

Enregistrer un commentaire