这两个框架都很棒,但我注意到 Knockout 喜欢指出它能够仅渲染添加到列表中的最新项目 - 而不是渲染整个列表。当然,这对于大型应用程序来说是性能增强器。
这是我正在谈论的示例(请务必选中“显示渲染时间”框): http://knockoutjs.com/examples/collections.html
但是,这似乎是任何主要的 javascript 框架都会有的东西 - 因为它是如此重要。
那么这个功能是否也融入到 Backbone 中,我将如何实现它?
Both of these frameworks are great, but I've noticed that Knockout likes to point out that it has the ability to render only the newest items that are added to a list - instead of rendering the whole list. Which, of course, is a performance booster for larger apps.
Here is an example of what I'm talking about (be sure to check the 'show render times' box): http://knockoutjs.com/examples/collections.html
But, this seems like something that any major javascript framework would have - since it is so important.
So is this feature also baked into Backbone, and how would I go about implementing it?
发布评论
评论(2)
以下是执行此操作的主干示例。
http://documentcloud.github.com/backbone/examples/todos/index.html
The following is a backbone sample that does just that.
http://documentcloud.github.com/backbone/examples/todos/index.html
我最近遇到了这个,它正是我正在寻找的: https://github.com/derickbailey/ backbone.modelbinding
Derick Bailey 是一位非常熟练的 JavaScript 开发人员,这里是他撰写的有关 Backbone 模型绑定的随附文章:
http://lostechies.com/derickbailey/ 2011/07/24/awesome-model-binding-for-backbone-js/
希望对其他人有帮助。
编辑
Derick还有一个用于Backbone的复合框架,以帮助减少样板代码:http://lostechies.com/derickbailey/2011/12/16/composite-javascript-applications-with-backbone-and-backbone-marionette/
I recently ran across this, which does exactly what I was looking for: https://github.com/derickbailey/backbone.modelbinding
Derick Bailey is a VERY proficient JavaScript developer and here is an accompanying article that he wrote about model-binding for Backbone:
http://lostechies.com/derickbailey/2011/07/24/awesome-model-binding-for-backbone-js/
Hope it's helpful to someone else.
EDIT
Derick also has a composite framework for Backbone to help reduce boilerplate code: http://lostechies.com/derickbailey/2011/12/16/composite-javascript-applications-with-backbone-and-backbone-marionette/