【发布时间】:2012-08-27 13:19:01
【问题描述】:
我正在使用 Phonegap + Zepto + Backbone 为 Blackberry OS5 开发应用程序。为了做到这一点,我一直在使用 Backbone-forms 来处理提交,但由于 OS5 的 jQuery 版本高于 1.4.4 存在问题,我搬到了 Zepto,但是 BackboneForms 上的渲染方法停止工作,谁能帮我吗?
这是中断的部分,完整代码请查看https://github.com/powmedia/backbone-forms:
render: function() {
var self = this,
options = this.options,
template = Form.templates[options.template];
//Create el from template - HERE IT BREAKS
var $form = $(template({
fieldsets: '<b class="bbf-tmp"></b>'
}));
//Render fieldsets
var $fieldsetContainer = $('.bbf-tmp', $form);
_.each(options.fieldsets, function(fieldset) {
$fieldsetContainer.append(self.renderFieldset(fieldset));
});
$fieldsetContainer.children().unwrap();
//Set the template contents as the main element; removes the wrapper element
this.setElement($form);
if (this.hasFocus) this.trigger('blur', this);
return this;
},
提前致谢!
【问题讨论】:
标签: backbone.js zepto