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.
87 lines
2.5 KiB
87 lines
2.5 KiB
7 years ago
|
# bi.bubble_combo
|
||
|
|
||
|
## 表示一个可以展开的节点, 不仅有选中状态而且有展开状态, 基类[BI.Widget](/core/widget.md)
|
||
|
|
||
|
{% method %}
|
||
|
[source](https://jsfiddle.net/fineui/urvt04so/)
|
||
|
|
||
|
{% common %}
|
||
|
```javascript
|
||
|
|
||
|
BI.createWidget({
|
||
|
type: "bi.bubble_combo",
|
||
|
element:"#wrapper",
|
||
|
el: {
|
||
|
type: "bi.button",
|
||
|
text: "测试",
|
||
|
height: 25
|
||
|
},
|
||
|
popup: {
|
||
|
el: {
|
||
|
type: "bi.button_group",
|
||
|
items: BI.makeArray(100, {
|
||
|
type: "bi.text_item",
|
||
|
height: 25,
|
||
|
text: "item"
|
||
|
}),
|
||
|
layouts: [{
|
||
|
type: "bi.vertical"
|
||
|
}]
|
||
|
},
|
||
|
maxHeight: 200
|
||
|
}
|
||
|
})
|
||
|
|
||
|
|
||
|
```
|
||
|
|
||
|
{% endmethod %}
|
||
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
7 years ago
|
| text | 组件text值 | string | —| "" |
|
||
|
| value | 组件value值 | string |— |""|
|
||
7 years ago
|
| stopEvent | 阻止事件 |boolean | true,false | false |
|
||
|
| stopPropagation | 阻止冒泡 | boolean | true,false| false |
|
||
|
| selected | button的选中状态 | boolean | true,false |false |
|
||
|
| once | 点击一次选中有效,再点无效 | boolean | true,false | false|
|
||
|
| forceSelected | 点击即选中, 选中了就不会被取消,与once的区别是forceSelected不影响事件的触发| boolean | true,false| false|
|
||
|
| forceNotSelected | 无论怎么点击都不会被选中 | boolean| true,false | false|
|
||
|
| disableSelected | 使能选中| boolean | true,false| false|
|
||
|
| shadow | 是否显示阴影 | boolean| true,false| false|
|
||
|
| isShadowShowingOnSelected| 选中状态下是否显示阴影|boolean| true,false | false|
|
||
|
| trigger | 被选元素要触发的事件 | string | mousedown, mouseup, click, dblclick, lclick | null|
|
||
7 years ago
|
| handler | 点击事件回调 | function | —| BI.emptyFn |
|
||
7 years ago
|
|
||
|
|
||
|
|
||
|
## 对外方法
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| bindEvent | 绑定事件| —|
|
||
|
| beforeClick | 点击事件之前 | —|
|
||
|
| doClick | 点击事件 | — |
|
||
|
| handle | 返回该对象 | —|
|
||
|
| hover | hover事件| —|
|
||
|
| dishover | 取消hover事件| —|
|
||
|
|setSelected | 设置选中的文本| b|
|
||
|
| isSelected | 是否被选中| —|
|
||
|
| isOnce | 是否只允许点击一次| —|
|
||
|
| isForceSelected| 判断是否点击即选中| —|
|
||
|
| isForceNotSelected| 判断是否怎么点击都不会被选中|—|
|
||
|
| isDisableSelected| 判断是否让选中|—|
|
||
|
| setText| 设置文本值|—|
|
||
|
| getText| 获取文本值|—|
|
||
|
| empty| 清空组件|—|
|
||
|
| destroy| 销毁组件|—|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
---
|
||
|
|
||
7 years ago
|
|