Category Archives: Sproutcore

Adding row number to SC.TableView

I’m using the new SC.TableView from github.com/endash/endash Add the following column. Note that the key is set to a dummy property in your model that does not exist. In the formatter method, I get the row index, add 1 and display it. Tweet

Sproutcore Buildfiles

Here’s some notes on buildfiles: 1. Buildfile in apps/my_app directory override Buildfile in the project directory 2. Specify required framework in apps/my_app directory Buildfile 3. Put URL proxy in project directory Buildfile 4. Default Buildfile settings is found here. Tweet

Developing Sproutcore Guides on Ubuntu

EDIT 2001-09-03: This seems to be working now with the latest ruby, blunder and gems. I don’t get the errors below anymore. 1. Need to update gems to 1.4.1. First apt-get the rubygems1.9.1 package. This will get you gems 1.3.5 Next, follow the instructions here to install rubygems from source. 2. Need to install bundle [...]

Sproutcore Tutorial: Custom ListView with Reordering

I’ve been reading a few different blog posts on creating a custom list view and re-ordering. I’ve decided to consolidate what I’ve learnt into this tutorial. Get the code here. See it in action here. This sample app allows you to: View a list with custom row views. Reorder items in the list by way [...]

Sproutcore: Cannot call method ‘create’ of undefined

I was playing around with a SC.View (MyApp.AView) which has a SC.ListView with a custom exampleView (MyApp.BView). I kept getting the error when SC.ListItem was trying to render the child view. Turned out to be a script sequencing problem. MyApp.BView was instanced AFTER MyApp.AView. It needed to be instanced before MyApp.AView. The fix is to [...]

What’s with the guid/uuid directory created by sc-build?

When I run sc-build, the output is placed in ./tmp/build/static/app_name/en/b82a3bf91217954903a4fd7da14707caa9f47520. This page in the Sproutcore wiki suggests that the guid/uuid directory is the build number. Deploying When you are ready to deploy your app, all you need to do is run sc-build. sc-build generates a bundle of HTML, JS, and CSS inside a directory with [...]

Sproutcore CRUD tutorial using SC.TableView

Note This tutorial is for Sproutcore 1.X. I’ve written a similar tutorial for Sproutcore 2 here. OK. I’ve reach the point in my Sproutcore understanding where I feel I can attempt to write a CRUD demo app. Get the code here. See it in action here. The demo app allows the user to: Create a [...]

Sproutcore RC.Record primary keys, guids and ids

Every Sproutcore record needs a primary key. By default, the primary key is named guid. You can change the name of your primary key by using the primaryKey attribute. For example, below we’ve changed the name of our primary key to userID. Here’s the catch. If you need to retrieve the value of your primaryKey, [...]

Using the latest Sproutcore code from the master branch

Got this tip from Colin Codes. Standard Sproutcore Install I’ve installed Sproutcore using However, this is NOT the latest development code. It is the latest released code. Using the Latest Code from the Master Branch All you have to do is to clone the latest sproutcore code from github into a frameworks directory within your [...]

Sproutcore sc-server undefined method ‘empty?’ (NoMethodError)

Over the weekend, I took the latest copy of Sproutcore Abbot build tools following the instructions provided in http://wiki.sproutcore.com/Abbot-Setting+Up. Upon starting sc-server, I get the error ./sc-server:9:in `’: undefined method `empty?’ for nil:NilClass (NoMethodError) I checked the ruby code inside sc-server: I think Abbot 1.4 has changed so that it can only be run from [...]