我一直在看这个示例Introduction to Backbone.js Part 2。
在这个例子中,当我点击按钮时,会调用render函数:
events: {
"click button": "render"
},如何在模型加载时调用render函数?
var view = new View({ model: model });发布于 2012-05-09 19:34:39
您只需将以下行this.render();添加到视图类中的初始化函数中
initialize: function()
{
this.template = $('#list-template').children();
this.render();
},https://stackoverflow.com/questions/10515092
复制相似问题