From 107523343c2f1c1fa0a72920ee1532bd53602cec Mon Sep 17 00:00:00 2001 From: Cheton Wu Date: Sun, 3 Apr 2016 14:16:58 +0800 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c7e1fc..a4b9ba4 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ File: [examples/test4.js](https://github.com/cheton/flattree/blob/master/example Kilo (.1.2) ``` -## Node API +## Node API Documentation #### node.getChildAt(index) Gets a child node at the specified index. From 388a4e0d9b100b7802ac42a5280f43a0ed21a08e Mon Sep 17 00:00:00 2001 From: Cheton Wu Date: Sun, 3 Apr 2016 14:20:42 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 65 +------------------------------------------------------ 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/README.md b/README.md index a4b9ba4..e0449d6 100644 --- a/README.md +++ b/README.md @@ -80,70 +80,7 @@ console.log(nodes); ## Examples -Given a hierarchical tree structure like below: - -```json -{ - "id": "", - "label": "", - "children": [ - { - "id": "alpha", - "label": "Alpha" - }, - { - "id": "bravo", - "label": "Bravo", - "children": [ - { - "id": "charlie", - "label": "Charlie", - "children": [ - { - "id": "delta", - "label": "Delta", - "children": [ - { - "id": "echo", - "label": "Echo" - }, - { - "id": "foxtrot", - "label": "Foxtrot" - } - ] - }, - { - "id": "golf", - "label": "Golf" - } - ] - }, - { - "id": "hotel", - "label": "Hotel", - "children": [ - { - "id": "india", - "label": "India", - "children": [ - { - "id": "juliet", - "label": "Juliet" - } - ] - } - ] - }, - { - "id": "kilo", - "label": "Kilo" - } - ] - } - ] -} -``` +Given a hierarchical tree structure like [this](https://github.com/cheton/flattree/blob/master/test/fixtures/tree.json), you can build a tree in any form. For example: ### Flat List View File: [examples/test1.js](https://github.com/cheton/flattree/blob/master/examples/tree1.js)