0
我有幾條路徑,它可以是無限深度和路徑數量。利用骨幹相對路徑列表 - 根據路徑對它們進行分組
1m,並從服務器獲取數據,包含路徑字段,例如每個模型:
"/home/harry/"
"/home/sally/"
"/home/sally/personal"
"/home/harry/files"
"/home/harry/photos"
"/home/harry/videos"
"/home/harry/files/documents"
"/home/harry/files/personal"
"/home/harry/photos/2012"
"/home/harry/photos/2011"
"/home/harry//videos/2012"
"/home/harry/videos/edited"
"/home/harry/videos/edited/other/trash_this"
我想組的機型,這樣我可以在我的web應用程序代表了文件結構,這樣你就可以點擊「home」並列出所有的相關目錄等等。因此,您可以進一步點擊該結構,直到該文件夾/目錄中沒有更多文件或目錄。
這裏是在Backbone.js的分層數據相關的問題:http://stackoverflow.com/questions/7682805/ backbone-js-and-hierarchies-trees –
謝謝喬治。該示例使用了一個parent_id屬性,它鏈接到彼此的路徑,在我的情況下,我只是有一個路徑。不確定在示例中它將如何實現。 – Harry