dojox » VirtualGrid » _resize
dojox.VirtualGrid._resize
dojo.require("dojox.grid.VirtualGrid");
defined in dojox/grid/VirtualGrid.js
Usage
function () (view source)
if(!this.domNode.parentNode || this.domNode.parentNode.nodeType != 1 || !this.hasLayout()){ return; } // useful measurement var padBorder = this._getPadBorder(); // grid height if(this.autoHeight){ this.domNode.style.height = 'auto'; this.viewsNode.style.height = ''; }else if(this.flex > 0){ }else if(this.domNode.clientHeight <= padBorder.h){ if(this.domNode.parentNode == document.body){ this.domNode.style.height = this.defaultHeight; }else{ this.fitTo = "parent"; } } // if we are given dimensions, size the grid's domNode to those dimensions if(this._sizeBox){ dojo.contentBox(this.domNode, this._sizeBox); }else if(this.fitTo == "parent"){ var h = dojo._getContentBox(this.domNode.parentNode).h; dojo.marginBox(this.domNode, { h: Math.max(0, h) }); } var h = dojo._getContentBox(this.domNode).h; if(h == 0 && !this.autoHeight){ // We need to hide the header, since the Grid is essentially hidden. this.viewsHeaderNode.style.display = "none"; }else{ // Otherwise, show the header and give it an appropriate height. this.viewsHeaderNode.style.display = "block"; } // NOTE: it is essential that width be applied before height // Header height can only be calculated properly after view widths have been set. // This is because flex column width is naturally 0 in Firefox. // Therefore prior to width sizing flex columns with spaces are maximally wrapped // and calculated to be too tall. this.adaptWidth(); this.adaptHeight(); // default row height (FIXME: use running average(?), remove magic #) this.scroller.defaultRowHeight = this.rows.getDefaultHeightPx() + 1; this.postresize();