Question

How can I open a widget in a new browser tab like window.open() from Ext4.2.1 application. I need to be able to open widget in a new browser tab similar to what 'maximize' tool does but for the whole thing to open in a new tab window.My best guess so far is to open a prepared .aspx page like window.open(url) and somehow to pass the widget to the window. But the tricky part is to pass the widget , there can be many widget to pass ,so I can't just hardcode the widget on the page.
Any idea would be helpful.

Was it helpful?

Solution

Ext based applications starts with main Ext.container.Viewport inside Ext.app.Application. The solution is to question the state of the application before the main Viewport is built. For example in my case I question the URL params . If in the params there is some param - in my case 'widget' I know that I need to build a single widget based on widget name from URL param (?widget='somewidgetalias'). I then create the widget by alias and a single widget viewport(regular viewport with no items) and I pass this created widget as item.

 Ext.create('NG.view.WidgetViewport', { 
            items: [{
                xtype: widgetName
            }]
        });

If I don't see the param in the URL , I continue to create a regular general viewport that creates the application. From the main application I open a new window with javascript like this : window.open(url, '_blank', specs);, the URL is the URL of the application and the param of widget='somewidgetalias' .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top