Horizontal web part sizing

LabKey Support Forum (Inactive)
Horizontal web part sizing Leo Dashevskiy  2012-09-26 16:38
Status: Closed
 
Hello!

I have a custom file-based web part and for some reason, if besides it such web parts as "Files" or "Experiment Runs" are also included on a project's home page / dashboard, then my web part's outer container (the <%=webpartContext%>.wrapperDivId) gets severely stretched horizontally (to over 5K pixels), whereas its child ('pnlTabs' see below) stays of proper width.

I sort of mimicked how the sizing is done in 'dataViews.jsp', but it uses Ext4 and I'm using Ext(3).
And extra line I added was
        Ext.EventManager.fireWindowResize();

(If the web part is on its own or I have other web parts, which are my own, then there is no such sizing issue...)

In my begin.html I have:


<script type='text/javascript'>

    var initOpenCytoVisualization = function()
    {
        var webPartDiv = <%=webpartContext%>.wrapperDivId;

        var OpenCytoVisualization = new LABKEY.ext.OpenCytoVisualization({
            webPartDivId: webPartDiv
        });

        var resizeModule = function(w, h) {

            LABKEY.Utils.resizeToViewport( OpenCytoVisualization, w, -1, null, null, 0 );

            OpenCytoVisualization.resize();
        };

        Ext.EventManager.onWindowResize( resizeModule );
        Ext.EventManager.fireWindowResize();
    }

    Ext.onReady( initOpenCytoVisualization );

</script>



And my OpenCytoVisualization.js has:


Ext.namespace('LABKEY', 'LABKEY.ext');

LABKEY.ext.OpenCytoVisualization = Ext.extend( Ext.Panel, {

            constructor : function(config) {
...
                this.items = [ pnlTabs ];
                this.layout = 'fit';
                this.renderTo = config.webPartDivId;

                LABKEY.ext.OpenCytoVisualization.superclass.constructor.apply(this, arguments);

            }, // end constructor

            resize : function(){ ... }

        } // end OpenCytoVisualization Panel class
);


Any help is appreciated!

Thanks.
-Leo
 
 
Leo Dashevskiy responded:  2012-10-04 18:54
Hi folks!

I also noticed the following:

If the built-in web part (say, "Experiment Runs (Flow)" is first on the page) and my web part ("OpenCyto Visualization") is second, then they both get their widths correctly, whereas if I have "OpenCyto Visualization" first (on its own it's fine) and then add the "Experiment Runs (Flow)" web part, then the latter get stretched excessively horizontally outside the browser screen (horizontal scroll bars, of course, appear) and "OpenCyto Visualization" web part's inner container (my own code) is of the right size, as it should be, but the outer web part (the border) is stretched the same width as the "Experiment Runs (Flow)" below (thus there is lots of white space between the right edge of the inner container (my own code) and the right edge of the outer web part. See the attached screen capture (the horizontal scroll bars are not shown).

Feel free to check out my web part via this link: https://github.com/ldash/OpenCytoVisualization.git

Would anyone know, what the deal is?

Thanks a bunch.
-Leo
 
Leo Dashevskiy responded:  2013-03-30 11:17
Not too important at the moment.