From 510ae7fac342ed2ef66000ca45364bf708d08b85 Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 1 Sep 2017 10:03:19 +0800 Subject: [PATCH] update tree --- uidoc/SUMMARY.md | 2 +- uidoc/case/tree/branch_tree.md | 13 +++++- uidoc/case/tree/display_tree.md | 42 ++++++++++++++++++- uidoc/case/tree/handstand_branch_editor.md | 2 - uidoc/case/tree/handstand_branch_tree.md | 48 ++++++++++++++++++++++ 5 files changed, 102 insertions(+), 5 deletions(-) delete mode 100644 uidoc/case/tree/handstand_branch_editor.md create mode 100644 uidoc/case/tree/handstand_branch_tree.md diff --git a/uidoc/SUMMARY.md b/uidoc/SUMMARY.md index b61669ada..87252cdc4 100644 --- a/uidoc/SUMMARY.md +++ b/uidoc/SUMMARY.md @@ -108,7 +108,7 @@ * [text_value_downlist_combo](case/combo/text_value_downlist_combo.md) * 树 * [branch_tree](case/tree/branch_tree.md) - * [handstand_branch_editor](case/tree/handstand_branch_editor.md) + * [handstand_branch_tree](case/tree/handstand_branch_tree.md) * [display_tree](case/tree/display_tree.md) * [simple_tree](case/tree/simple_tree.md) * [level_tree](case/tree/level_tree.md) diff --git a/uidoc/case/tree/branch_tree.md b/uidoc/case/tree/branch_tree.md index feebafde1..9f8655c11 100644 --- a/uidoc/case/tree/branch_tree.md +++ b/uidoc/case/tree/branch_tree.md @@ -6,7 +6,18 @@ {% common %} ```javascript -// More coming... +BI.createWidget({ + type: "bi.branch_tree", + element: 'body', + items: [{ + el: {}, + children: [{ + el: {}, + children: {}, + // ... + }] + }] +}); ``` {% endmethod %} diff --git a/uidoc/case/tree/display_tree.md b/uidoc/case/tree/display_tree.md index 9a5973be8..2c5c1136c 100644 --- a/uidoc/case/tree/display_tree.md +++ b/uidoc/case/tree/display_tree.md @@ -1,2 +1,42 @@ -# display_tree +# bi.display_tree + +### 异步树控件 + +{% method %} +[source](https://jsfiddle.net/fineui/cfL6fpa1/) + +{% common %} +```javascript +var tree = BI.createWidget({ + type: "bi.display_tree", + element: 'body', +}); + +tree.initTree({ + id: 1, + text: '', + open: true, +}); +``` + +{% endmethod %} + + + +### 参数设置 + +| 参数 | 说明 | 类型 | 默认值 | +| -------- | -------------------- | ------ | ---- | +| — | — | — | — | + + + +### 方法 + +| 方法名 | 说明 | 回调参数 | +| -------- | ------ | ---- | +| initTree | 加载tree结构 | node: 节点数组 settings: 配置项 | +| destroy | 摧毁元素 | — | + + diff --git a/uidoc/case/tree/handstand_branch_editor.md b/uidoc/case/tree/handstand_branch_editor.md deleted file mode 100644 index 94fa8db15..000000000 --- a/uidoc/case/tree/handstand_branch_editor.md +++ /dev/null @@ -1,2 +0,0 @@ -# handstand_branch_editor - diff --git a/uidoc/case/tree/handstand_branch_tree.md b/uidoc/case/tree/handstand_branch_tree.md new file mode 100644 index 000000000..fb550cb2c --- /dev/null +++ b/uidoc/case/tree/handstand_branch_tree.md @@ -0,0 +1,48 @@ +# handstand_branch_tree + +# bi.branch_tree +### 纵向分支的树 + +{% method %} +[source](https://jsfiddle.net/fineui/c2kaoc7x/) + +{% common %} +```javascript +BI.createWidget({ + type: "bi.handstand_branch_tree", + element: 'body', + el: {}, + items: [{ + el: {}, + children: [{ + el: {}, + children: {}, + // ... + }] + }] +}); +``` + +{% endmethod %} + + + +### 参数设置 + +| 参数 | 说明 | 类型 | 默认值 | +| -------- | -------------------- | ------ | ---- | +| expander | branch_expander组件配置项 | object | {} | +| el | | object | {} | +| items | 子项 | array | [] | + + + +### 方法 + +| 方法名 | 说明 | 回调参数 | +| -------- | ------ | ---- | +| populate | 去掉所有内容 | — | +| getValue | 获取所选项值 | — | + + +