我需要从视图中访问隐藏的表单值:
I have tried this: form.getValue('user')
但我无权访问视图中的表单对象:
我的观点:
var View = Backbone.View.extend({
el: '#panel',
events: {
'submit #form': 'save'
},// end of events
save: function (ev) {
var Details = $(ev.currentTarget).serializeObject();
console.log(form.getValue('user'))
var obj = new model();
obj.save(Details, {
success: function (obj) {
},
error: function (model, response) {
console.log('error', model, response);
}
});
}
});