【发布时间】:2012-10-16 15:11:36
【问题描述】:
我知道这个错误已经出现了几次,但我仍然不确定如何使这个工作正常..
我的魔法从这里开始:
var list_edit_member_view = new app.views.ListMemberEdit({
el: $("#enterprise_member_list_edit_container"),
list_ids: list_ids
});
list_edit_member_view.render();
这会加载这个视图 (ListMemberEdit.js),它在 render() 中有这个:
this.list_edit_member_view = new app.views.CollectionView({
el: $("#enterprise_member_list_edit_container"),
collection: app.peers,
list_item: app.views.ListMemberEditSelection,
list_item_options: {list_ids: this.options.list_ids}
});
它加载了一个 CollectionView 视图,该视图将其list_item_options 呈现为模型视图。它位于此文件 (ListMemberEditSelection.js) 中,当我执行this.destroy 时,它将返回:
Uncaught Error: A "url" property or function must be specified
所以这让我觉得模型或模型 URL 没有被定义..我只是不确定把它放在哪里,因为它的工作方式与我做大致相同事情的其他部分非常相似..
有什么想法吗?我为含糊而道歉。如果您还有什么想看的,请告诉我!
我很好奇是否有可能看到 在哪里这个 URL 属性将被写入对象模型或集合本身。
【问题讨论】:
标签: backbone.js