Skip to content

Instantly share code, notes, and snippets.

@m-vdb
Created June 4, 2013 15:37
Show Gist options
  • Save m-vdb/5706897 to your computer and use it in GitHub Desktop.
Save m-vdb/5706897 to your computer and use it in GitHub Desktop.
Param form (Backbone.Form)
var ParamForm = window.Interface.BaseForm.extend({
initialize: function(options){
options.schema = {
client_name: {type: 'Text', title: 'Client Name', validators: ['required'], editorClass: 'client_name'},
name: {type: 'Text', title: 'Short Name', editorClass: 'name', fieldClass: 'hidden'},
urls: {type: 'List', title: 'Source urls', validators: ['url']},
exporters: {type: 'List', title: 'Facebook Pages', itemType: 'InlineObject', validators: [this.validateListExporter],
subSchema: {
name: {type: 'Text', title: 'Name', validators: ['required']},
exporter: {type: 'Exporter', title: 'Type',
options: window.Interface.exporterCollection},
parameters: {type: 'Object', title: '', subSchema: {
facebook_page_id: {type: 'Text', title: 'Page Id', validators: ['required']},
config_password: {type: 'Text', title: 'API Secret'},
'config/tracking': {type: 'Text', title: 'Tracking Code'}
}}
}}
};
Backbone.Form.prototype.initialize.call(this, options);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment