如何使用 Backbone.Js 创建嵌套模型
我正在尝试使用 Backbone.Js 创建一个任务应用程序。任务是在服务器端表示的模型,如下所示
Task
TaskName (string)
SubTasks (List<Task>)
Tasks (List<UserTask>)
我如何声明一个像任务这样嵌套的模型(请参阅
子任务
)。我应该如何/可以显示可以在单个视图上嵌套n级的数据(如果是最佳的)是否存在针对此类问题的任何模式。(当然树视图不是)对于这样的事情很友好,缩进可以帮助嵌套,但仅限于一定程度,并且我们受到浏览器、桌面、移动设备的屏幕尺寸的限制)
I am trying to create a Task application with Backbone.Js. Task is a model represented on server side as below
Task
TaskName (string)
SubTasks (List<Task>)
Tasks (List<UserTask>)
How do i declare a model that is nested like Task (see
SubTasks
) here.How should / can i display a data that could be n-level nested on a single view(if it is optimal) does any pattern exist for such a problem.( certainly treeview isn't that friendly for something like this, Indentation can aid in nesting but upto a certain level only & we are limited by screen sizes of browsers, desktop, mobile)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这个链接可以解决您的问题 http://documentcloud.github.com/backbone/#FAQ-嵌套。
另一种选择可能是主干关系库 https://github.com/PaulUithol/Backbone-relational
干杯,
法布里齐奥
Perhaps this link can solve your problem http://documentcloud.github.com/backbone/#FAQ-nested.
An alternative could be the backbone relational library https://github.com/PaulUithol/Backbone-relational
Cheers,
Fabrizio