forked from fanruan/fineui
iapyang
7 years ago
4 changed files with 204 additions and 11 deletions
@ -1,2 +1,71 @@
|
||||
# collection_table |
||||
# bi.collection_table |
||||
|
||||
### 继承BI.Widget |
||||
|
||||
{% method %} |
||||
[source](https://jsfiddle.net/fineui/0e7p2ezc/) |
||||
|
||||
{% common %} |
||||
```javascript |
||||
BI.createWidget({ |
||||
type: "bi.excel_table", |
||||
element: "body", |
||||
columnSize: [200,200], |
||||
items: [ |
||||
[{ |
||||
type: "bi.label", |
||||
cls: "layout-bg1", |
||||
text: "第一行第一列" |
||||
}, { |
||||
type: "bi.label", |
||||
cls: "layout-bg2", |
||||
text: "第一行第二列" |
||||
}], |
||||
[{ |
||||
type: "bi.label", |
||||
cls: "layout-bg3", |
||||
text: "第二行第一列" |
||||
}, { |
||||
type: "bi.label", |
||||
cls: "layout-bg4", |
||||
text: "第二行第二列" |
||||
}] |
||||
] |
||||
}); |
||||
``` |
||||
|
||||
{% endmethod %} |
||||
|
||||
## 参数设置 |
||||
| 参数 | 说明 | 类型 | 默认值 | |
||||
| ---------------- | ------------- | -------------------- | ----------------- | |
||||
| isNeedFreeze | 是否冻结列 | bool | false | |
||||
| freezeCols | 冻结的列 | array | [] | |
||||
| isNeedMerge | 是否需要合并单元格 | bool | false | |
||||
| mergeCols | 合并的单元格列号 | array | [] | |
||||
| mergeRule | 合并规则, 默认相等时合并 | function(row1, row2) | 默认row1 = row2 时合并 | |
||||
| columnSize | 单元格宽度集合 | array | [] | |
||||
| headerRowSize | 表头高度 | number | 25 | |
||||
| rowSize | 普通单元格高度 | number | 25 | |
||||
| regionColumnSize | 列项间的 | array | [] | |
||||
| items | 子组件 | array | [] | |
||||
|
||||
## 方法 |
||||
| 方法名 | 说明 | 用法 | |
||||
| ------------------------- | ----------- | ------------------------------------ | |
||||
| setWidth | 设置宽度 | setWidth(width) | |
||||
| setHeight | 设置高度 | setHeight(height) | |
||||
| setColumnSize | 设置列宽 | setColumnSize(columnSize) | |
||||
| getColumnSize | 得到列宽 | getColumnSize() | |
||||
| setRegionColumnSize | 设置列项之间的间隙 | setRegionColumnSize(columnSize) | |
||||
| getRegionColumnSize | 获得列项之间的间隙 | getRegionColumnSize() | |
||||
| getScrollRegionColumnSize | 获取横向滚动条宽度 | getScrollRegionColumnSize() | |
||||
| setVerticalScroll | 设置纵向滚动距离 | setVerticalScroll(scrollTop) | |
||||
| setLeftHorizontalScroll | 设置左到右横向滚动距离 | setLeftHorizontalScroll(scrollLeft) | |
||||
| setRightHorizontalScroll | 设置右往左横向滚动距离 | setRightHorizontalScroll(scrollLeft) | |
||||
| getVerticalScroll | 获取纵向滚动距离 | getVerticalScroll() | |
||||
| getLeftHorizontalScroll | 获取左到右横向滚动距离 | getLeftHorizontalScroll() | |
||||
| getRightHorizontalScroll | 获取右往左横向滚动距离 | getRightHorizontalScroll() | |
||||
| getColumns | 获取列项 | getColumns() | |
||||
| populate | 增加行 | populate(rows) | |
||||
| restore | 存储数据 | restore() | |
@ -1,2 +1,56 @@
|
||||
# grid_table |
||||
# bi.grid_table |
||||
|
||||
### 列表展示的table,继承BI.Widget |
||||
|
||||
{% method %} |
||||
[source](https://jsfiddle.net/fineui/a936vcvj/) |
||||
|
||||
{% common %} |
||||
```javascript |
||||
BI.createWidget({ |
||||
type: "bi.grid_table", |
||||
element: 'body', |
||||
width: 600, |
||||
height: 500, |
||||
isResizeAdapt: true, |
||||
isNeedResize: true, |
||||
isNeedFreeze: true, |
||||
freezeCols: [0, 1], |
||||
columnSize: [50,50,200,250,400], |
||||
items: items, |
||||
header: header |
||||
}); |
||||
``` |
||||
|
||||
{% endmethod %} |
||||
|
||||
## 参数设置 |
||||
| 参数 | 说明 | 类型 | 默认值 | |
||||
| ---------------- | ------- | ------ | ----- | |
||||
| isNeedFreeze | 是否需要冻结 | bool | false | |
||||
| freezeCols | 冻结列 | array | [] | |
||||
| columnSize | 单元格宽度集合 | array | [] | |
||||
| headerRowSize | 表头高度 | number | 25 | |
||||
| rowSize | 普通单元格高度 | number | 25 | |
||||
| regionColumnSize | 列项间的 | array | [] | |
||||
| header | 表头 | array | [] | |
||||
| items | 子组件 | array | [] | |
||||
|
||||
## 方法 |
||||
| 方法名 | 说明 | 用法 | |
||||
| ------------------------ | ----------- | ------------------------------------ | |
||||
| setWidth | 设置宽度 | setWidth(width) | |
||||
| setHeight | 设置高度 | setHeight(height) | |
||||
| getRegionSize | 获取间隙大小 | getRegionSize() | |
||||
| setColumnSize | 设置列宽 | setColumnSize(columnSize) | |
||||
| getColumnSize | 得到列宽 | getColumnSize() | |
||||
| setRegionColumnSize | 设置列项之间的间隙 | setRegionColumnSize(columnSize) | |
||||
| getRegionColumnSize | 获得列项之间的间隙 | getRegionColumnSize() | |
||||
| setVerticalScroll | 设置纵向滚动距离 | setVerticalScroll(scrollTop) | |
||||
| setLeftHorizontalScroll | 设置左到右横向滚动距离 | setLeftHorizontalScroll(scrollLeft) | |
||||
| setRightHorizontalScroll | 设置右往左横向滚动距离 | setRightHorizontalScroll(scrollLeft) | |
||||
| getVerticalScroll | 获取纵向滚动距离 | getVerticalScroll() | |
||||
| getLeftHorizontalScroll | 获取左到右横向滚动距离 | getLeftHorizontalScroll() | |
||||
| getRightHorizontalScroll | 获取右往左横向滚动距离 | getRightHorizontalScroll() | |
||||
| populate | 增加行 | populate(rows) | |
||||
| restore | 储存 | restore() | |
||||
|
@ -1,2 +1,74 @@
|
||||
# resizable_table |
||||
# bi.resizable_table |
||||
|
||||
### 可调整列宽的grid表格,继承BI.Widget |
||||
|
||||
{% method %} |
||||
[source]() |
||||
|
||||
{% common %} |
||||
```javascript |
||||
BI.createWidget({ |
||||
type: "bi.resizable_table", |
||||
element: "body", |
||||
columnSize: [200,200], |
||||
items: [ |
||||
[{ |
||||
type: "bi.label", |
||||
cls: "layout-bg1", |
||||
text: "第一行第一列" |
||||
}, { |
||||
type: "bi.label", |
||||
cls: "layout-bg2", |
||||
text: "第一行第二列" |
||||
}], |
||||
[{ |
||||
type: "bi.label", |
||||
cls: "layout-bg3", |
||||
text: "第二行第一列" |
||||
}, { |
||||
type: "bi.label", |
||||
cls: "layout-bg4", |
||||
text: "第二行第二列" |
||||
}] |
||||
] |
||||
}); |
||||
``` |
||||
|
||||
{% endmethod %} |
||||
|
||||
## 参数设置 |
||||
| 参数 | 说明 | 类型 | 默认值 | |
||||
| ---------------- | --------- | ------ | ----- | |
||||
| isNeedFreeze | 是否需要冻结列 | bool | false | |
||||
| freezeCols | 冻结的列 | array | [] | |
||||
| isNeedResize | 是否需要调整大小 | bool | false | |
||||
| isResizeAdapt | 是否调整时自适应 | bool | true | |
||||
| isNeedMerge | 是否需要合并单元格 | bool | false | |
||||
| mergeCols | 合并的单元格列号 | array | [] | |
||||
| columnSize | 单元格宽度集合 | array | [] | |
||||
| minColumnSize | 最小列宽 | array | [] | |
||||
| maxColumnSize | 最大列宽 | array | [] | |
||||
| headerRowSize | 表头高度 | number | 25 | |
||||
| rowSize | 普通单元格高度 | number | 25 | |
||||
| header | 表头 | array | [] | |
||||
| regionColumnSize | 列项间的 | array | [] | |
||||
| items | 子组件 | array | [] | |
||||
|
||||
## 方法 |
||||
| 方法名 | 说明 | 用法 | |
||||
| ------------------------ | ----------- | ------------------------------------ | |
||||
| setWidth | 设置宽度 | setWidth() | |
||||
| setHeight | 设置高度 | setHeight() | |
||||
| setColumnSize | 设置列宽 | setColumnSize(columnSize) | |
||||
| getColumnSize | 得到列宽 | getColumnSize() | |
||||
| setRegionColumnSize | 设置列项之间的间隙 | setRegionColumnSize(columnSize) | |
||||
| getRegionColumnSize | 获得列项之间的间隙 | getRegionColumnSize() | |
||||
| setVerticalScroll | 设置纵向滚动距离 | setVerticalScroll(scrollTop) | |
||||
| setLeftHorizontalScroll | 设置左到右横向滚动距离 | setLeftHorizontalScroll(scrollLeft) | |
||||
| setRightHorizontalScroll | 设置右往左横向滚动距离 | setRightHorizontalScroll(scrollLeft) | |
||||
| getVerticalScroll | 获取纵向滚动距离 | getVerticalScroll() | |
||||
| getLeftHorizontalScroll | 获取左到右横向滚动距离 | getLeftHorizontalScroll() | |
||||
| getRightHorizontalScroll | 获取右往左横向滚动距离 | getRightHorizontalScroll() | |
||||
| attr | 设置属性 | attr(key, value) | |
||||
| populate | 增加行 | populate(rows) | |
||||
| restore | 保存表 | restore() | |
Loading…
Reference in new issue