Skip to content

Instantly share code, notes, and snippets.

View ColinCampbell's full-sized avatar

Colin Campbell ColinCampbell

View GitHub Profile
deleteVersion: function () {
var version = this.get('version'),
arrangedObjects = ContentManager.versionsController.get('arrangedObjects'),
idx = arrangedObjects.indexOf(version);
version.destroy();
version.commitRecord();
this.invokeLater(function () {
var object, test;
// start from the previous item
collectionViewShouldSelectIndexes: function(view, indexes) {
return indexes.filter(function(index) {
return view.get('content').objectAt(index).get('isFoo');
}
}
/* in views */
sc_require('renderers/custom_list_item_renderer');
MyApp.CustomListItem = SC.ListItemView.extend({
createRenderer: function(theme) {
var ret = theme.customListItem();
this.updateRenderer(ret);
return ret;
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
// Portions ©2008-2009 Apple Inc. All rights reserved.
// License: Licened under MIT license (see license.js)
// ==========================================================================
/** @class
@extends SC.Renderer
@since SproutCore 1.1
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
// Portions ©2008-2009 Apple Inc. All rights reserved.
// License: Licened under MIT license (see license.js)
// ==========================================================================
/** @class
@extends SC.Renderer
@since SproutCore 1.1
@ColinCampbell
ColinCampbell / test.js
Created March 12, 2010 19:55 — forked from enyo/test.js
components: SC.ScrollView.design({
layout: { top: 20, bottom: 10, left: 10, right: 10 },
contentView: SC.ListView.design({
content: [
{ name: 'test' },
{ name: 'test2' },
{ name: 'test3' },
sc_require('models/record');
App.Customer = App.Record.extend({
/**
Walk like a duck
@property {Boolean}
@default YES
@isReadOnly