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.
55 lines
1.4 KiB
55 lines
1.4 KiB
7 years ago
|
# bi.searcher_view
|
||
|
|
||
7 years ago
|
## 搜索面板, 基类[BI.Widget](/core/widget.md)
|
||
7 years ago
|
|
||
|
{% method %}
|
||
7 years ago
|
[source](https://jsfiddle.net/fineui/qkfns6wm/)
|
||
7 years ago
|
|
||
|
{% common %}
|
||
|
```javascript
|
||
|
|
||
7 years ago
|
var searcher = BI.createWidget({
|
||
|
element: "#wrapper",
|
||
|
type: "bi.searcher_view",
|
||
|
});
|
||
|
searcher.populate([{
|
||
|
text: "aba",
|
||
|
value: "aba"
|
||
|
},{
|
||
|
text: "acc",
|
||
|
value: "acc"
|
||
|
}], [{
|
||
|
text: "a",
|
||
|
value: "a"
|
||
|
}], "a");
|
||
7 years ago
|
|
||
|
|
||
|
|
||
|
```
|
||
|
|
||
|
{% endmethod %}
|
||
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
|
| tipText | title文本 | string | — | BI.i18nText("BI-No_Select") |
|
||
7 years ago
|
| chooseType | 选择类型 | const | 参考button_group | BI.Selection.Single |
|
||
7 years ago
|
| matcher | 完全匹配的构造器 | object | — | {type: "bi.button_group",behaviors: { redmark: function () { return true;} },items: [], layouts: [{ type: "bi.vertical"}]} |
|
||
7 years ago
|
| searcher | 搜索到的元素 | object| — | {type: "bi.button_group",behaviors: {redmark: function () {return true;}}, items: [], layouts: [{ type: "bi.vertical" }]}|
|
||
7 years ago
|
|
||
|
## 对外方法
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| populate | 刷新列表 | searchResult, matchResult, keyword |
|
||
|
| setValue | 设置value 值 | value |
|
||
|
| getValue| 获取value值 | —|
|
||
|
| empty | 清空组件 | —|
|
||
|
| hasMatched | 是否有匹配的元素 | —|
|
||
|
|
||
|
|
||
|
|
||
|
---
|
||
|
|
||
7 years ago
|
|