powmedia / backbone-forms

Form framework for BackboneJS with nested forms, editable lists and validation
MIT License
2.17k stars 413 forks source link

Unable to Define list datatype in the Schema #313

Open hknbs opened 11 years ago

hknbs commented 11 years ago

schema: {

  firstName: {validators: ['required']},
  lastName: {validators: ['required']},
  middleNames:{validators: ['required']},
  login: {validators: ['required']},
  pass: {validators: ['required']},
  phone: 'Text',
  email:  {validators: ['required']},
BirthDate:  'Date',
 Gender: {
    type: 'Select',
    options: ['Male', 'Female']
  },
  levels: {
    type: 'Select',
    options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
  },
  roles: {
    type: 'Checkboxes',
    options: ['admin', 'student', 'teacher', 'head', 'coach', 'lead']
  },
  resources:      { type: 'List', itemType: 'Text' }
},

I have this schema but when i define resources: { type: 'List', listType: 'Text' } it give me TypeError constructorFN is not a constructor, please elaborate this issue

exussum12 commented 11 years ago

http://jsfiddle.net/4XZMb/1931/

Works fine, Have you included list.js ? (https://github.com/powmedia/backbone-forms/blob/master/distribution/editors/list.js)

The jsfiddle URL is the example one replaced with your schema