Sha256: ce421efeedacf716925f26711bd43dc49659db4dc80d1d51b625172cf12bd961

Contents?: true

Size: 1.34 KB

Versions: 41

Compression:

Stored size: 1.34 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            Portions ©2008-2011 Apple, Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/**
  A delegate for table resize operations.
*/
SC.TableDelegate = {
  /**
    Walk like a duck.
  */
  isTableDelegate: YES,
  
  /**
    Called just before a table resizes a column to a proposed width.  You
    can use this method to constrain the allowed width.  The default 
    implementation uses the minWidth and maxWidth of the column object.
  */
  tableShouldResizeColumnTo: function(table, column, proposedWidth) {
    var min = column.get('minWidth') || 0,
        max = column.get('maxWidth') || proposedWidth;
    
    proposedWidth = Math.max(min, proposedWidth);
    proposedWidth = Math.min(max, proposedWidth);
    
    return proposedWidth;
  },
  
  tableShouldResizeWidthTo: function(table, proposedWidth) {
    var min = table.get('minWidth') || 0,
        max = table.get('maxWidth') || proposedWidth;
        
    proposedWidth = Math.max(min, proposedWidth);
    proposedWidth = Math.min(max, proposedWidth);
    
    return proposedWidth;
  }
};

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js