指定我知道这个错误已经拿出了几次,但我仍然不知道如何使这项工作适当地..未捕获的错误:“URL”属性或功能必须为的CollectionView
我魔术从这里开始:
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),其中有这样的渲染():
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'在模型中像你描述的那样实例化。在工作方面,如果我做'$ .bar.model.collection.url',我可以找到一个写出来的URL ..所以问题是...集合URL的实例化在哪里,如果它不像你这样的模型建议.. – Trip