You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
3.1 KiB
88 lines
3.1 KiB
7 years ago
|
# bi.combo
|
||
|
|
||
|
## combo,基类[BI.Widget](/core/widget.md)
|
||
|
|
||
|
{% method %}
|
||
7 years ago
|
[source](https://jsfiddle.net/fineui/wxykkjou/)
|
||
7 years ago
|
|
||
|
{% common %}
|
||
|
```javascript
|
||
|
|
||
|
BI.createWidget({
|
||
|
type: "bi.combo",
|
||
7 years ago
|
element: "body",
|
||
7 years ago
|
adjustLength: 2,
|
||
|
el: {
|
||
|
type: "bi.button",
|
||
|
text: "测试",
|
||
|
height: 25
|
||
|
},
|
||
7 years ago
|
popup: {}
|
||
7 years ago
|
});
|
||
|
|
||
|
|
||
|
|
||
|
```
|
||
|
|
||
|
{% endmethod %}
|
||
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
7 years ago
|
| el | 自定义下拉框trigger | object | — |{ }|
|
||
|
| trigger | 下拉列表的弹出方式 | string | click,hover | "click" |
|
||
|
| adjustLength | 弹出列表和trigger的距离 | number | — | 0 |
|
||
7 years ago
|
| toggle | 切换状态 | boolean | true,false | true |
|
||
7 years ago
|
| direction | 弹出列表和trigger的位置关系 | string | top | bottom | left | right | top,left | top,right | bottom,left | bottom,right | "bottom"|
|
||
7 years ago
|
| isDefaultInit | 是否默认初始化子节点 |boolean | true,false | false |
|
||
7 years ago
|
| destroyWhenHide | 隐藏弹窗层是否销毁 | boolean | true,false | false |
|
||
|
| isNeedAdjustHeight | 是否需要高度调整 | boolean | true,false | true |
|
||
|
| isNeedAdjustWidth | 是否需要宽度调整 | boolean | true,false | true |
|
||
7 years ago
|
| stopEvent | 是否阻止事件 | boolean | true,false | false |
|
||
7 years ago
|
| stopPropagation | 阻止事件冒泡 | boolean | true,false | false |
|
||
|
| adjustXOffset | 调整横向偏移 | number | — | 0 |
|
||
|
| adjustYOffset |调整纵向偏移 | number | — | 0 |
|
||
7 years ago
|
| hideChecker | 是否隐藏弹出层检测 | function | — | —|
|
||
7 years ago
|
| offsetStyle | 弹出层显示位置 | string | left,right,center | "left,right,center"|
|
||
|
| popup | 弹出层 | object | — | { }|
|
||
7 years ago
|
| comboClass | combo类 | string | — | "bi-combo-popup" |
|
||
|
| hoverClass | hover类 | string | — | "bi-combo-hover" |
|
||
7 years ago
|
|
||
|
|
||
|
|
||
|
## 对外方法
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| adjustWidth | 调整宽度 | —|
|
||
|
| adjustHeight | 调整高度 | —|
|
||
|
| resetListHeight | 重置列表高度 | height |
|
||
|
| resetListWidth | 重置列表宽度 | width |
|
||
|
| populate | 刷新列表 | items |
|
||
|
| setValue |设置combo value值| v |
|
||
|
| getValue | 获取combo value值 | —|
|
||
|
| isViewVisible | 弹窗层是否可见 | —|
|
||
7 years ago
|
| showView | 显示弹出层 | —|
|
||
|
| hideView | 隐藏弹出层 |—|
|
||
|
| getView | 获取弹出层 | —|
|
||
|
| getPopupPosition | 获取弹出层的位置 | —|
|
||
|
| toggle | 开启或者隐藏弹出层 | —|
|
||
7 years ago
|
|
||
7 years ago
|
## 事件
|
||
|
| 名称 | 说明 |
|
||
|
| :------ |:------------- |
|
||
|
|BI.Combo.EVENT_TRIGGER_CHANGE | trigger发生改变触发 |
|
||
|
|BI.Combo.EVENT_CHANGE | 弹出层点击触发 |
|
||
|
|BI.Combo.EVENT_EXPAND | 下拉框展开触发 |
|
||
|
|BI.Combo.EVENT_COLLAPSE | 下拉框收起触发
|
||
|
|BI.Combo.EVENT_AFTER_INIT | 下拉框初始化后触发 |
|
||
|
|BI.Combo.EVENT_BEFORE_POPUPVIEW | 下拉列表弹出前触发 |
|
||
|
|BI.Combo.EVENT_AFTER_POPUPVIEW | 下拉列表弹出后触发 |
|
||
|
|BI.Combo.EVENT_BEFORE_HIDEVIEW | 下拉列表收起前触发 |
|
||
|
|BI.Combo.EVENT_AFTER_HIDEVIEW | 下拉列表收起后触发 |
|
||
7 years ago
|
|
||
|
|
||
7 years ago
|
---
|
||
|
|
||
7 years ago
|
|