From ee81b49e595f8ca1bc9dff9b12e1b2933ac30003 Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 1 Sep 2017 14:00:08 +0800 Subject: [PATCH] finish case/tree --- uidoc/case/tree/branch_relation.md | 40 +++++++++++++++++++++- uidoc/case/tree/handstand_branch_tree.md | 2 -- uidoc/case/tree/level_tree.md | 42 +++++++++++++++++++++++- uidoc/case/tree/simple_tree.md | 39 +++++++++++++++++++++- 4 files changed, 118 insertions(+), 5 deletions(-) diff --git a/uidoc/case/tree/branch_relation.md b/uidoc/case/tree/branch_relation.md index cefc75900..235077251 100644 --- a/uidoc/case/tree/branch_relation.md +++ b/uidoc/case/tree/branch_relation.md @@ -1,2 +1,40 @@ -# branch_relation +# bi.branch_relation + +### 表关联树 + +{% method %} +[source](https://jsfiddle.net/fineui/z5hLcruk/) + +{% common %} +```javascript +var tree = BI.createWidget({ + type: "bi.simple_tree", + element: 'body', + items: [], + direction: BI.Direction.Right, + align: BI.HorizontalAlign.Right, + centerOffset: -50 +}); +``` + +{% endmethod %} + + + +### 参数设置 + +| 参数 | 说明 | 类型 | 默认值 | +| ------------ | ------- | ------ | -------------------- | +| centerOffset | 重心偏移量 | number | 0 | +| direction | 根节点所在方向 | string | BI.Direction.Bottom | +| align | 对齐方向 | string | BI.VerticalAlign.Top | +| items | 元素 | array | null | + + + +### 方法 + +| 方法名 | 说明 | 回调参数 | +| -------- | ---- | ----------- | +| populate | 刷新内容 | items: 子项数组 | diff --git a/uidoc/case/tree/handstand_branch_tree.md b/uidoc/case/tree/handstand_branch_tree.md index fb550cb2c..e21e8af1f 100644 --- a/uidoc/case/tree/handstand_branch_tree.md +++ b/uidoc/case/tree/handstand_branch_tree.md @@ -1,5 +1,3 @@ -# handstand_branch_tree - # bi.branch_tree ### 纵向分支的树 diff --git a/uidoc/case/tree/level_tree.md b/uidoc/case/tree/level_tree.md index 0e8f42a8b..06c72371c 100644 --- a/uidoc/case/tree/level_tree.md +++ b/uidoc/case/tree/level_tree.md @@ -1,2 +1,42 @@ -# level_tree +# bi.level_tree + +### 二级树 + +{% method %} +[source](https://jsfiddle.net/fineui/nvvkwhfo/) + +{% common %} +```javascript +var tree = BI.createWidget({ + type: "bi.level_tree", + element: 'body', + items: [], +}); +``` + +{% endmethod %} + + + +### 参数设置 + +| 参数 | 说明 | 类型 | 默认值 | +| -------- | ----------------- | ------ | ---- | +| expander | branch_expander配置 | object | {} | +| items | 元素 | array | [] | + + + +### 方法 + +| 方法名 | 说明 | 回调参数 | +| -------------- | -------- | ----------- | +| initTree | 构造树结构 | nodes | +| stroke | 生成树方法 | nodes | +| populate | 刷新内容 | items: 子项数组 | +| setValue | 设置值 | v | +| getValue | 获得值 | — | +| getAllLeaves | 获取所有叶节点 | — | +| getNodeById | 根据Id获取节点 | id | +| getNodeByValue | 根据值获取节点 | id | diff --git a/uidoc/case/tree/simple_tree.md b/uidoc/case/tree/simple_tree.md index 0669611e6..86b7f4eed 100644 --- a/uidoc/case/tree/simple_tree.md +++ b/uidoc/case/tree/simple_tree.md @@ -1,2 +1,39 @@ -# simple_tree +# bi.simple_tree + +### 简单的多选树 + +{% method %} +[source](https://jsfiddle.net/fineui/5qtobqxb/) + +{% common %} +```javascript +var tree = BI.createWidget({ + type: "bi.simple_tree", + element: 'body', +}); + +tree.populate(items); +``` + +{% endmethod %} + + + +### 参数设置 + +| 参数 | 说明 | 类型 | 默认值 | +| ------------ | -------- | -------- | ---------- | +| itemsCreator | items构造器 | function | BI.emptyFn | +| items | 元素 | array | null | + + + +### 方法 + +| 方法名 | 说明 | 回调参数 | +| -------- | ---- | ------------------------------ | +| populate | 刷新内容 | items: 子项数组 keywords: 关键字标红字符串 | +| setValue | 设置值 | v | +| getValue | 获得值 | — | +| empty | 清空树 | — |