Backbone with a tree view widget

后端 未结 3 2032
我在风中等你
我在风中等你 2020-12-12 20:31

I\'m evaluating the Backbone javascript framework for use in a project that will display a hierarchical model in a tree view widget (think the Windows file browser).

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 20:58

    one option if you don't want to travel down the hierarchical data-set path, is to use a Nested Set (http://en.wikipedia.org/wiki/Nested_set_model). this allows you to store the entire collection in a single array (or list or whatever you want to call it) and use a "left" and "right" value to determine the structure and hierarchy of the list.

    if i remember right, this technique was originally build to optimize data storage and queries in a relational database. however, i've used it a number of times in C#/Winforms applications, to avoid having a recursive hierarchy of data, and it worked well.

    an implementation of this in javascript should be pretty easy, but i don't know how well it would perform with a large list.

提交回复
热议问题