Skip to content

Instantly share code, notes, and snippets.

@ialexi
Forked from sproutit/FormView API Sample.js
Created October 26, 2009 19:19
Show Gist options
  • Select an option

  • Save ialexi/218940 to your computer and use it in GitHub Desktop.

Select an option

Save ialexi/218940 to your computer and use it in GitHub Desktop.
myForm: SC.FormView.design({
layout: { top: 0, left: 0, right: 0, bottom: 40 },
rows: 'name gender'.w(),
contentBinding: "MyApp.fooController",
// if row gets a class as a first argument, it conveniently sets up a structure
// like the following, but with only one field.
name: SC.FormView.row({
fields: "firstName lastName".w(),
fieldLabel: "Name:",
firstName: SC.FormView.field(SC.TextFieldView, { fieldKey: "firstname" }),
lastName: SC.FormView.field(SC.TextFieldView, { fieldKey: "lastname "})
}),
gender: SC.FormView.row(SC.RadioView, {
layout: { width: 100 },
items: 'male female'.w(),
fieldKey: 'contactGender',
fieldLabel: "Gender:",
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment