Skip to content

Instantly share code, notes, and snippets.

@ColinCampbell
Created August 6, 2010 15:31
Show Gist options
  • Select an option

  • Save ColinCampbell/511492 to your computer and use it in GitHub Desktop.

Select an option

Save ColinCampbell/511492 to your computer and use it in GitHub Desktop.
volumeCount: SC.FormView.row(SC.LabelView, {
layout: {height: 18, width: 50},
label: 'RANDOM'
})
// this gets passed through to:
row: function(label, fieldType, ext)
{
if (label.isClass) {
ext = fieldType;
fieldType = label;
label = null;
}
// now, create a hash (will be used by the parent form's exampleRow)
if (!ext) ext = {};
ext.label = label;
ext.childViews = ["_singleField"];
ext._singleField = fieldType;
return ext;
}
// The first if statement passes, so label is set to null. Makes sense, as you want to knock out that parameter
// but in the next part, ext.label gets overwritten by label (null), so it doesn't use the passed value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment