Skip to content

Instantly share code, notes, and snippets.

ORDER_DEFINITION: [ SC.T_ERROR,
SC.T_UNDEFINED,
SC.T_NULL,
SC.T_BOOL,
SC.T_NUMBER,
SC.T_STRING,
SC.T_ARRAY,
SC.T_HASH,
SC.T_OBJECT,
SC.T_FUNCTION,
// ==========================================================================
// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Apple, Inc. and contributors.
// License: Licened under MIT license (see license.js)
// ==========================================================================
/*globals module ok equals same test MyApp */
// test parsing of query string
var v = [];
module("SC.compare()", {
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_6; de-de) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16
Hide passed testsCompleted 484 tests in 66935 msec. 1730 total assertions: 1651 passed 79 failed
Test Result
SC.compare() module: ordering should work - 93msec (26, 79, 0, 0)
v[0] (null) should be smaller than v[1] (boolean), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[2] (boolean), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[3] (number), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[4] (number), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[5] (string), expected: -1 result: 0 FAILED
v[0] (null) should be smaller than v[6] (string), expected: -1 result: 0 FAILED
/**
Finds all storeKeys in this store
and returns an array.
@returns {Array} set of storeKeys
*/
storeKeys: function() {
ret = [];
if(!this.statuses) return;
_applyChangedOrder: function() {
if (!this.queryKey) return;
// clear cache
this._records = null;
// this actually sorts the store keys
this.storeKeys.sort();
// setting them manually works as well
//this.storeKeys = [key2, key1];
// ==========================================================================
// 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)
// ==========================================================================
require('core') ;
/**
@class
// ==========================================================================
// 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
SC.MyCouchdbDataSource = SC.DataSource.extend( {
database: "",
design: "",
cancelStoreKeys: {},
fetchRequest: SC.Request.getUrl("").set('isJSON', YES),
//descriptions: SC.RecordAttribute.create({
// toType: function(record, key, value) {
// var cacheKey = '__descriptions__'+ SC.guidFor(record) ;
// var query = record[cacheKey] ;
// if (!query) {
// query = record[cacheKey] = record.get('store').findAll(SC.Query.create({
// recordType: 'BB.Description',
// conditions: "concept = %@",
// parameters: [record]
// my main.js ---------------------------------
BB.main = function main() {
var usersQuery = SC.Query.create({recordType: BB.User});
BB.set('usersQuery', usersQuery);
var users = BB.store.findAll(BB.get('usersQuery'));
BB.set('users', users);
BB.store.dataSource.loadAllDocs(BB.store);