我尝试为完整的表单添加类属性。但我做不到。随着 Backbone.View 的形式扩展,我认为正确的获取方法是:
var form = new Backbone.Form({
model: myModel,
className: 'myClass'
}).render();
我也试过:
var MyForm = Backbone.Form.extend({
className: 'myClass'
schema: {
field1: 'Text'
}
});
var form = new MyForm({
model: myModel
}).render();
但在这两种情况下,输出都是:
<form data-fieldsets>
<fieldset data-fields>
//Code of form...
我认为输出将是:
<form class="myClass" data-fieldsets>
<fieldset data-fields>
//Code of form...