Knockout.js 相当于 holla 的示例
是否有一个类似于 Holla https://github.com 的 Knockout.js 更复杂的示例。 com/maccman/holla/commits/master/app ?
我想在左侧窗格上有一个列表/树,用于填充右侧窗格上的表单。
Is there a more complicated example of knockout.js along the lines of Holla https://github.com/maccman/holla/commits/master/app ?
I would like to have a list/tree on a left pane that would populate a form on a right side pane.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是主/详细信息应用程序的骨架。你可以在 jsfiddle 上看到它。在 JSFiddle 中,我稍微简化了代码,但最好有一个单独的选择函数,而不是直接使用
$parent.selectedItem
。如果您还要做其他事情,则需要在this
可能未绑定到正确对象的函数中使用var self = this;
变量。和 JavaScript:
Here's a skeleton for a master/details app. You can see it live on this jsfiddle. In the JSFiddle, I simplified the code a bit, but it's probably better to have a separate select function rather than using
$parent.selectedItem
directly. If you're doing other stuff as well, you'll want thevar self = this;
variable to use in functions wherethis
may not be bound to the right object.and the javascript: