function resizeCanvas(resizeOptions) {
      if (!initialized) { return; }

      var estimateH = MAX_INT;
      resizeOptions = resizeOptions || {};

      if (!resizeOptions.skipHeight) {
        if (options.autoHeight) {
          estimateH = getRowBottom(getDataLengthIncludingAddNew());
        } else {
          estimateH = getViewportHeight();
        }
        estimateH = Math.max(options.minHeight || 0, Math.min(options.maxHeight || MAX_INT, estimateH));
        var setHeight = (estimateH !== viewportH || options.minHeight === estimateH || options.maxHeight === estimateH);

        if (setHeight) {
          $viewport.height(estimateH);
          
          // Trouble is now we need to detect if we've been limited by any user styles on the *container*:
          var containerH = getContainerHeight();
          var actualViewportH = getViewportHeight();
          var viewportToContainerDeltaH = containerH - actualViewportH;

          if (viewportH !== actualViewportH) {
            // user CSS rules are apparently kicking in (min-height, max-height); compensate.
            viewportH = actualViewportH;
      
            $viewport.height(viewportH);
          }
        }
      }

      setViewportWidth(resizeOptions.width);

      //$viewport.css("overflow-y", (options.autoHeight && !clippedAutoSize) ? "auto" : "auto");

      if (options.forceFitColumns) {
        autosizeColumns();
      }

      //cleanUpAndRenderCells(getRenderedRange()); -- happens in render()
      updateRowCount();
      handleScroll(true);
      // Since the width has changed, force the render() to re-evaluate virtually rendered cells.
      lastRenderedScrollLeft = -1;
      render();
    }
// This saves 15ms or so.
This saves 15ms or so.
This saves 15ms or so .
function resizeCanvas(resizeOptions) {
      if (!initialized) { return; }
      var estimateH = MAX_INT;
      resizeOptions = resizeOptions || {};
      if (!resizeOptions.skipHeight) {
        if (options.autoHeight) {
          estimateH = getRowBottom(getDataLengthIncludingAddNew());
        } else {
          estimateH = getViewportHeight();
        }
        estimateH = Math.max(options.minHeight || 0, Math.min(options.maxHeight || MAX_INT, estimateH));
        var setHeight = (estimateH !== viewportH || options.minHeight === estimateH || options.maxHeight === estimateH);
        if (setHeight) {
          $viewport.height(estimateH);
          var containerH = getContainerHeight();
          var actualViewportH = getViewportHeight();
          var viewportToContainerDeltaH = containerH - actualViewportH;
          if (viewportH !== actualViewportH) {
            viewportH = actualViewportH;
            $viewport.height(viewportH);
          }
        }
      }
      setViewportWidth(resizeOptions.width);
      if (options.forceFitColumns) {
        autosizeColumns();
      }
      updateRowCount();
      handleScroll(true);
      lastRenderedScrollLeft = -1;
      render();
    }
function resizeCanvas ( resizeOptions ) { if ( ! initialized ) { return ; } var estimateH = MAX_INT ; resizeOptions = resizeOptions || { } ; if ( ! resizeOptions . skipHeight ) { if ( options . autoHeight ) { estimateH = getRowBottom ( getDataLengthIncludingAddNew ( ) ) ; } else { estimateH = getViewportHeight ( ) ; } estimateH = Math . max ( options . minHeight || 0 , Math . min ( options . maxHeight || MAX_INT , estimateH ) ) ; var setHeight = ( estimateH !== viewportH || options . minHeight === estimateH || options . maxHeight === estimateH ) ; if ( setHeight ) { $viewport . height ( estimateH ) ; var containerH = getContainerHeight ( ) ; var actualViewportH = getViewportHeight ( ) ; var viewportToContainerDeltaH = containerH - actualViewportH ; if ( viewportH !== actualViewportH ) { viewportH = actualViewportH ; $viewport . height ( viewportH ) ; } } } setViewportWidth ( resizeOptions . width ) ; if ( options . forceFitColumns ) { autosizeColumns ( ) ; } updateRowCount ( ) ; handleScroll ( true ) ; lastRenderedScrollLeft = - 1 ; render ( ) ; }
This saves 15ms or so.
This saves 15ms or so .
// Trouble is now we need to detect if we've been limited by any user styles on the *container*: // user CSS rules are apparently kicking in (min-height, max-height); compensate. //$viewport.css("overflow-y", (options.autoHeight && !clippedAutoSize) ? "auto" : "auto"); //cleanUpAndRenderCells(getRenderedRange()); -- happens in render() // Since the width has changed, force the render() to re-evaluate virtually rendered cells.