Rendering QueryWebPart in Ext.Window

LabKey Support Forum (Inactive)
Rendering QueryWebPart in Ext.Window Anthony Corbett  2013-01-24 08:39
Status: Closed
 

I want to be able to create multiple Ext.Window popups that each contain a QueryWebPart. More concretely, I want to display a custom view of SpecimenSummary where each Participant they search for would open a new Ext.Window containing a QueryWebPart of SpecimenSummary filtered to just that Participant. How best can this be done?

I'm wondering if I can use the items array of Ext.Window to automattically render the QueryWebPart inside of it's layout?


Thanks in advance!

-
Anthony Corbett
 
 
Ben Bimber responded:  2013-01-24 08:52
Mixing ext and DataRegions can be a real pain, since DataRegions are not a true Ext component. It's difficult to coax Ext to size the panels properly. I have three suggestions:

1) if you can get away with an Ext grid, nesting will work more automatically. With Ext grids, especially Ext3 grids, it can be a pain to make them look very good, and they will not automatically inherit all the features of a LabKey QWP. However, just showing the data will be much easier.

2) If you're using Ext3 (which you probably are if you dont know the answer to that), then place a panel inside the window and render the QWP to that panel's body element. Note: the panel will need to have been rendered first. Check out EHR.ext.QueryPanel in the EHR module. The file is under /customModules/ehr/resources/web/ExtContainers.js. This will show you how to defer loading the QWP until after render.

3) if you're using Ext4 (which I recommend), check out LDK.panel.QueryPanel in the LDK module. This is designed to be more of a standalone and it might work out of the box for you. The file is under /unsupportedModules/labModules/ldk/resources/web/QueryPanel.js

If you use this panel directly, it should be pretty automatic, although I've never tried this inside a window. it does get around most Ext layout problems, so far as i can tell.
 
Anthony Corbett responded:  2013-01-24 09:03
Ben,

Thanks for the quickly reply. Yes, I am using Ext4. I had a hunch that the QWP would fight with the EXT classes and that a manually managed rendering process would be needed. Sounds like the LDK.panel.QueryPanel will be a great place to start looking. I will let you know how everything turns out using a window.

Thanks!

-
Anthony
 
Ben Bimber responded:  2013-01-24 09:13
i've never done this in a window (getting it to work in a panel is hard enough), and my guess is that you might need to add another listener that resizes your window, unless the window can be made to autosize itself based on children.
 
dennisw responded:  2013-01-31 09:54
If you do manage to get a "Window" or "Window" like ext component working, one of the issues you may run into are z-order conflicts with the underlying LabKey UI components. I had to use native JS to manually jump my Window to pretty high z-order numbers to get things working correctly.