forked from fanruan/fineui
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.
2.8 KiB
2.8 KiB
bi.combo
combo,基类BI.Widget
{% method %} source
{% common %}
BI.createWidget({
type: "bi.combo",
element: “body”,
adjustLength: 2,
el: {
type: "bi.button",
text: "测试",
height: 25
},
popup: {}
});
{% endmethod %}
API
基础属性
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
trigger | 事件类型 | string | "click" | |
toggle | 切换状态 | boolean | true,false | true |
direction | combo弹出层位置 | string | top,bottom,left,right,(top,left),(top,right),(bottom,left),(bottom,right) | "bottom" |
isDefaultInit | 是否默认初始化子节点 | boolean | true,false | false |
destroyWhenHide | 隐藏弹窗层是否销毁 | boolean | true,false | false |
isNeedAdjustHeight | 是否需要高度调整 | boolean | true,false | true |
isNeedAdjustWidth | 是否需要宽度调整 | boolean | true,false | true |
stopEvent | 阻止事件冒泡 | boolean | true,false | false |
stopPropagation | 阻止事件冒泡 | boolean | true,false | false |
adjustLength | 调整的距离 | number | — | 0 |
adjustXOffset | 调整横向偏移 | number | — | 0 |
adjustYOffset | 调整纵向偏移 | number | — | 0 |
hideChecker | function | — | ||
offsetStyle | 弹出层显示位置 | string | left,right,center | "left,right,center" |
el | 开启弹出层的元素 | object | — | { } |
popup | 弹出层 | object | — | { } |
comboClass | string | "bi-combo-popup" | ||
hoverClass | string | "bi-combo-hover" |
对外方法
名称 | 说明 | 回调参数 |
---|---|---|
adjustWidth | 调整宽度 | — |
adjustHeight | 调整高度 | — |
resetListHeight | 重置列表高度 | height |
resetListWidth | 重置列表宽度 | width |
populate | 刷新列表 | items |
setValue | 设置combo value值 | v |
getValue | 获取combo value值 | — |
isViewVisible | 弹窗层是否可见 | — |
showView | ||
hideView | ||
getView | ||
getPopupPosition | ||
toggle | ||
destroy |
事件
名称 | 说明 |
---|---|
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 | 下拉列表收起后触发 |