Documentation

Windows: Linking two windows

In order to open a window from another window, a javascript action must be defined and linked to an event of the first window. That action can contain a js instruction openWindowXXX in order to open the second window, where XXX is the window identifier.

This method requires also an argument which can be js object where additional values can be set into, as in this example

var args = new Object();

args.parY = vo.parY;

openWindowXXX(args);

 

 

For instance, if the two windows contain both a grid and the grid contained in the second window should be filtered according to the selected row in the first one, am action can be defined to open the second window and linked to the “double click” event of the first grid.
In that case, the action would contain something like:

 

var args = new Object();
args.idElaborazioni = vo.idElaborazioni;
openWindow679(args);

 

 

 
In the second window, a new input parameter has to be defined for the window:
windowPars
Finally, in the second grid a new event should be listened to: “before loading data” and used to link it to an action containing instructions like the following:
grid1349.store.baseParams.quickFilterNames = 'idElaborazioni';
grid1349.store.baseParams.quickFilterOps = '=';
grid1349.store.baseParams.quickFilterValues = idElaborazioni;

 

In case a back reference is needed from the second grid to the first one, the (HTML element) id of the first grid can be passed forward and then used in the second grid; this id must be set asan attribute value of the js object passed to openWindowXXX method:
var args = new Object();

args.parentGridId = gridZZZ.id;

openWindowXXX(args);

 

 
The second grid can refer the first grid with the following utility method:
var gridPanelId = args.parentGridId;

var parentGrid = Ext.ComponentMgr.get(gridPanelId);

parentGrid.store.reload();