This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax(url2, { | |
type:"GET", | |
crossDomain:true, | |
dataType: "jsonp", | |
jsonp:"testCallback", | |
data:'json', | |
success:function(data, text, xhqr) { | |
$.each(data, function(i, item) { | |
alert(item); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//List view is my group Fixture | |
sc_require('models/list'); | |
Demo.List.FIXTURES = [ | |
{ guid: 1, listDescription: "Basics"}, | |
{ guid: 2, listDescription: "Run Time"}, | |
{ guid: 3, listDescription: "JavaScript Basics"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================================================================== | |
// Project: Jeff - mainPage | |
// Copyright: ©2010 My Company, Inc. | |
// ========================================================================== | |
/*globals Jeff */ | |
// This page describes the main user interface for your application. | |
Jeff.mainPage = SC.Page.design({ | |
// The main pane is made visible on screen as soon as your app is loaded. | |
// Add childViews to this pane for views to display immediately on page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contentView: SC.ListView.design({ | |
contentBinding: 'Todos.tasksController.arrangedObjects', | |
selectionBinding: 'Todos.tasksController.selection', | |
contentValueKey: "description", | |
contentCheckboxKey: "isDone", | |
rowHeight: 21, | |
canEditContent: YES, | |
canDeleteContent: YES, | |
target: "Todos.tasksController", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sc_require('models/task'); | |
Todos.Task.FIXTURES = [ | |
{ "guid": "task-1", | |
"description": "Build my first SproutCore app", | |
"isDone": false }, | |
{ "guid": "task-2", | |
"description": "Build a really awesome SproutCore app", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Todos.Task = SC.Record.extend( | |
/** @scope Todos.Task.prototype */ { | |
isDone: SC.Record.attr(Boolean), | |
description: SC.Record.attr(String), | |
}) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sc_require('models/task'); | |
Todos.TASKS_QUERY = SC.Query.local(Todos.Task, { | |
orderBy: 'isDone,description' | |
}); | |
// ========================================================================== | |
// Project: Todos.TaskDataSource | |
// Copyright: ©2010 My Company, Inc. | |
// ========================================================================== | |
/*globals Todos */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadRecords: function(recordTypes, dataHashes, ids) { | |
var isArray = SC.typeOf(recordTypes) === SC.T_ARRAY, | |
len = dataHashes.get('length'), | |
ret = [], | |
K = SC.Record, | |
recordType, id, primaryKey, idx, dataHash, storeKey; | |
// save lookup info | |
if (!isArray) { | |
recordType = recordTypes || SC.Record; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"task":{"isDone":true,"created_at":"2010-08-13T06:21:00Z","updated_at":"2010-08-13T06:21:00Z","order":1,"id":1,"description":"This is the first task"}},{"task":{"isDone":false,"created_at":"2010-08-13T06:21:00Z","updated_at":"2010-08-13T06:21:00Z","order":2,"id":2,"description":"This is the second task"}},{"task":{"isDone":true,"created_at":"2010-08-13T06:21:00Z","updated_at":"2010-08-13T06:21:00Z","order":3,"id":3,"description":"This is the third task"}},{"task":{"isDone":false,"created_at":"2010-08-14T04:51:45Z","updated_at":"2010-08-14T04:51:52Z","order":null,"id":4,"description":"kyle"}},{"task":{"isDone":false,"created_at":"2010-08-14T04:51:58Z","updated_at":"2010-08-14T04:52:02Z","order":null,"id":5,"description":"about"}},{"task":{"isDone":false,"created_at":"2010-08-14T04:52:05Z","updated_at":"2010-08-14T04:52:09Z","order":null,"id":6,"description":"time"}},{"task":{"isDone":false,"created_at":"2010-08-14T04:52:32Z","updated_at":"2010-08-14T04:59:57Z","order":null,"id":7,"description":"Here is a tes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Todos.TaskJSONProxy = SC.Object.create( | |
normalize_task_data: function(data) { | |
result = new Array(); | |
if (data.length == undefined) | |
{ | |
array_name = 'data.task'; | |
eval(array_name).guid = eval(array_name).id; | |
result.push(eval(array_name)); | |
} | |
else |
NewerOlder