Sha256: 12e79fc39be23b82c533495f8a5d7984819e44cb3a7dd87b97d6e12196458a8d

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

// ==========================================================================
// Project:   Showcase
// Copyright: @2012 Tyler Keating
// ==========================================================================
/*globals Showcase */
sc_require('system/views_item_content.js');
sc_require('views/views_list_view.js');


/**
  This pre-configured view demonstrates SC.StackedView.
*/
Showcase.stackedViews = SC.ScrollView.design({
  contentView: Showcase.ViewsListView.design({
    content: [
      Showcase.ViewsItemContent.create({
        title: 'Regular',
        example: "SC.ScrollView.extend({  classNames: ['my-scroll-view'],  layout: { left: 20, right: 20, top: 20, bottom: 20 },  contentView:  SC.StackedView.extend({  classNames: ['my-stacked-view'],  content: ['These rows have statically laid out content with random heights.  Selecting a row causes the row to re-render and change its height.',1,2,3,4,5,6],  exampleView: SC.View.extend({  displayProperties: ['isSelected'],  useStaticLayout: true,  render: function(context) {  context.setClass('sel', this.get('isSelected'));  context.push('<div style=\"height: ' + (20 + Math.round((Math.random() * 100))) + 'px;\">' + this.get('content') + '</div>');  }  }),  selectionDidChange: function() {  this.updateHeight(false);  }.observes('selection')  })  })"
      })
    ],
    exampleHeight: 420
  })
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sproutcore-1.9.2 lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js
sproutcore-1.9.1 lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js
sproutcore-1.9.0 lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js