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 |
|||||||||||||||||||
| |||||||||||||||||||