Desktop: dynamically adding a new window

Desktop: dynamically adding a new window

I've scoured the examples and searched the forums but drawn a blank. I have the ExtJS Desktop working great, but all the windows are pre-defined via either desktop icons or the start menu. What about if one of those windows includes a button that, when clicked, should open a new window that also gets added to the list of open windows on the taskbar?

I haven't seen any examples of this and I can't figure out how I'd go about doing it - how and where to define the new window and how to get it added to the desktop? I've tried a few things but without success.

Also, would there be anything special about how such a window would be deleted once closed?

If anyone can point me in the right direction and/or can point me at any examples, that should be enough to get me on my way again.

One problem - any ideas?

One problem - any ideas?

OK one problem I've discovered with this approach. The adhoc window module appears to need to be added to the getModules list in order for it to be generally available, but this means that one instance appears on the start menu list. The best I've been able to achieve is to remove its text, icon and handler:

Problem is that, yes, what you're suggesting adds a new window, but it's not a desktop window in the sense that it doesn't have a minimize and maximise button, and it's not added to the taskbar when it's instantiated.

Can that functionality be added by simply adding extra properties etc to the new Ext.Window code you've suggested?

In fact with a small modification to App.js, I've been able to achieve what I wanted using the technique I've described, so the windows are all properly registered in the taskbar and exhibit the expected taskbar-related behaviour, but the "baseline" one no longer gets added to the start menu.

me too

me too

I too have looked through a ton of posts and line by line through the code but I still don't get it. I need to be able to dynamically add windows.

I have the desktop working and popping up windows from the desktop shortcuts but I don't know how to correctly popup windows from those pages (i.e. show then in the taskbar as well). What do I put instead of an a href? What code should that call?

When I tried the code above I keep getting the error...

ms has no properties
[Break on this error] for(var i = 0, len = ms.length; i < len; i++){
App.js line 60