Sha256: 144ab407d41b6b45619923ac1768299196b88e247d59558ad7c8904fa5c1cf5c

Contents?: true

Size: 1.67 KB

Versions: 30

Compression:

Stored size: 1.67 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            portions copyright @2011 Apple Inc.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*
  This test evaluates a plain list with no custom row heights, outlines, 
  group views or any other non-standard behavior.
*/

module("SC.ListView - outline list");

var TreeItem = SC.Object.extend(SC.TreeItemContent, {

  length: 10,
  
  title: "TREE ITEM",
  
  depth: 0,
  
  treeItemChildren: function() {
    var ret = [], loc = this.get('length'), depth = this.get('depth')+1;
    if (depth>3) loc = loc*3
    while(--loc>=0) ret[loc] = TreeItem.create({ parent: this, unread: loc, depth: depth, treeItemIsExpanded: (depth<2) });
    return ret ;
  }.property().cacheable(),  
  
  treeItemIsExpanded: YES,
  
  treeItemBranchIndexes: function() {
    return this.depth<3 ? SC.IndexSet.create(0, this.get('length')) : null;
  }

});

var root = TreeItem.create({ treeItemIsExpanded: YES });
var del = SC.Object.create();

var pane = SC.ControlTestPane.design()
  .add("basic", SC.ScrollView.design({
    layout: { left: 0, right: 0, top: 0, height: 300 },
    hasHorizontalScroller: NO,
    contentView: SC.ListView.design({
      content: SC.TreeItemObserver.create({ item: root, delegate: del }),
      contentValueKey: "title",
      contentCheckboxKey: "isDone",
      contentUnreadCountKey: "unread",
      rowHeight: 20
      
    })
  }));
  
pane.show(); // add a test to show the test pane
window.pane = pane ;

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.1 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.rc.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.rc.2 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.rc.2-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.rc.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.rc.1 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.rc.1-java lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js
sproutcore-1.6.0.beta.3-x86-mingw32 lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js