2016-05-06 21 views
1

我正在使用JSON模式和骨幹形式第一次。我複製了同樣的例子在骨幹形式提及,但它給錯誤,如下圖所示:骨幹形式給錯誤作爲未捕獲TypeError:t不是一個構造函數

enter image description here

的代碼如下提到:

var registerForm = Backbone.Model.extend({ 
    schema:{ 
     title:  { type: 'Select', options: ['Mr', 'Mrs', 'Ms'] }, 
    name:  'Text', 
    email:  { validators: ['required', 'email'] }, 
    birthday: 'Date', 
    password: 'Password', 
    notes:  { type: 'List', itemType: 'Text' } 
    } 
}); 
var user = new registerForm(); 
var form = new Backbone.Form({ 
    model: user 
}).render();   $('body').append(form.el); 

請幫我解決這個問題。

回答

0

您不能包含List編輯器。這是一個特殊的編輯器,在一個單獨的文件必須包括:

<script type="text/javascript" src="backbone-forms/distribution/editors/list.js" /> 

https://github.com/powmedia/backbone-forms#list

相關問題