View Full Version : Web Desktop, open same window multiple times and catch events inside controller (MVC)

14 Feb 2013, 3:56 PM

I've been playing with a web-desktop layout for a few months and everything is going great using unique windows (each window is unique and can only be opened once).

Now I'd like to have the ability to open the same window multiple times.
Looking at the Web Desktop example, it would be like opening a "Notepad" window each time you click on the notepad icon.

To be more precise about my use case, I'd like my users to be able to compare grid windows, where the content of the grid is loaded dynamically. For example, one window would display content from year 2011, the other window would display content from year 2012, both on the same screen.

I don't want to set limits on the number of times this grid window can be opened.

My questions is pretty simple, how to catch events coming from such windows created automatically ?

On my existing app, as things are not dynamic (one window can only be opened once), I'm simply using itemID.

Inside the view (for example on a button):

itemId: 'menuCreateDataAnalysis',

Inside the controller:

init: function() { this.control({
'#menuCreateDataAnalysis': {click: this.createDataAnalysis }

What should be the best way to start ? And generally what would you recommend in such a situation ?