3

我正在关注这个小提琴http://jsfiddle.net/evilcelery/4XZMb/

$(function() {
    //Use BootstrapModal for object List editor
    Backbone.Form.editors.List.Modal.ModalAdapter = Backbone.BootstrapModal;

    //Main model definition
    var User = Backbone.Model.extend({
        schema: {
            title:      { type: 'Select', options: ['', 'Mr', 'Mrs', 'Ms'] },
            name:       'Text',
            email:      { validators: ['required', 'email'] },
            birthday:   'Date',
            password:   'Password',
            notes:      { type: 'List' },
            weapons:    { type: 'List', itemType: 'Object', subSchema: {
                name: { validators: ['required'] },
                number: 'Number'
            }}
        }
    });

    var user = new User({
        title: 'Mr',
        name: 'Sterling Archer',
        email: 'sterling@isis.com',
        birthday: new Date(1978, 6, 12),
        password: 'dangerzone',
        notes: [
            'Buy new turtleneck',
            'Call Woodhouse',
            'Buy booze'
        ],
        weapons: [
            { name: 'Uzi', number: 2 },
            { name: 'Shotgun', number: 1 }
        ]
    });

    //The form
    var form = new Backbone.Form({
        model: user
    }).render();

    //Add it to the page
    $('body').append(form.el);
});

对于我的申请。但是,我无法在单击“武器”列表时查看模态对话框视图。它在小提琴中正确显示,但是当我尝试在我的应用程序中做同样的事情时,它不包括我的视图中的模式对话框。有人可以帮助我吗?在我的应用程序中添加模态对话框视图是否需要任何特殊的事件处理程序?

4

0 回答 0