Skip to content

Instantly share code, notes, and snippets.

View bushxnyc's full-sized avatar

Brian Pinkney bushxnyc

  • Atlanta, GA (USA)
View GitHub Profile
@bushxnyc
bushxnyc / gist:1950317
Created March 1, 2012 15:03
SelectView valueChange
MyApp.selectedCategoriesController = SC.ArrayController.create({
contentBinding: SC.Binding.oneWay('MyApp.selectedActionController.categories')
});
MyApp.selectedCategoryController = SC.ObjectController.create({
contentBinding: SC.Binding.oneWay('MyApp.categoryListView.menu.selectedItem.value')
});
MyApp.selectedSubCategoriesController = SC.ArrayController.create({
contentBinding: SC.Binding.oneWay('MyApp.selectedCategoryController.subCategories')
@bushxnyc
bushxnyc / gist:1727428
Created February 3, 2012 03:23
Query Lockup
sc_require('data');
SC.mixin(V6Grapher, {
// Retrieve graph data from source
getGraphingData: function() {
return V6Grapher.Data.split("\n");
},
@bushxnyc
bushxnyc / gist:1454268
Created December 10, 2011 02:05
How to insert text into SC.View tags
left: SC.View.extend({
layout: {bottom: 0, left: 0, height: 47, width: 117},
classNames: ['left'],
innerHTML: 'Previous',
})
@bushxnyc
bushxnyc / gist:1315133
Created October 26, 2011 01:25
oneTomany Relationship in Sproutcore
App.Category = SC.Record.extend({
name: SC.Record.attr(String),
parent: SC.Record.toOne('App.Category'),
lft: SC.Record.attr(Number),
rgt: SC.Record.attr(Number),
itemType: SC.Record.attr(String),
listings: SC.Record.toMany('App.Listing', {inverse: "category"}),
//Tree Properties
treeItemIsExpanded: NO,