forked from fanruan/fineui
60 lines
1.5 KiB
60 lines
1.5 KiB
7 years ago
|
# bi.formula_editor
|
||
|
|
||
|
## 公式编辑控件,基类[BI.Single](/core/single.md)
|
||
|
|
||
|
{% method %}
|
||
7 years ago
|
[source](https://jsfiddle.net/fineui/qnquz4o0/)
|
||
7 years ago
|
|
||
|
{% common %}
|
||
|
```javascript
|
||
|
|
||
|
BI.createWidget({
|
||
7 years ago
|
type: "bi.formula_editor",
|
||
|
cls: "bi-border",
|
||
|
watermark:'请输入公式',
|
||
|
value: 'SUM(C5, 16, 26)',
|
||
|
width: "100%",
|
||
|
height: "100%"
|
||
7 years ago
|
});
|
||
|
|
||
|
|
||
|
```
|
||
|
|
||
|
{% endmethod %}
|
||
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
7 years ago
|
| value | 文本域的值 | string | — | " "|
|
||
|
| watermark | 文本框placeholder| string | —| " " |
|
||
7 years ago
|
| fieldTextValueMap | 字段集合 | onject | —| {}|
|
||
|
| showHint | 是否显示提示信息 | boolean | true,false | true |
|
||
7 years ago
|
| lineHeight | 行高 | number | —| 2|
|
||
7 years ago
|
|
||
|
|
||
|
|
||
|
## 对外方法
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| disableWaterMark | 设置文本框placeholder不可用 | — |
|
||
|
| focus | 文本框获取焦点| — |
|
||
|
| insertField | 添加字段 | field |
|
||
7 years ago
|
| insertFunction | 插入函数 | fn |
|
||
|
| insertOperator | 插入操作符| op|
|
||
|
| setFunction | 设置函数 | v|
|
||
7 years ago
|
| insertString | 插入字符串 | str|
|
||
7 years ago
|
| getFormulaString | 获取公式框内容 |— |
|
||
7 years ago
|
| getUsedFields | 获取可用字段 | — |
|
||
7 years ago
|
| getCheckString | 获取校验内容 | — |
|
||
7 years ago
|
| getValue | 获取文本框值|—|
|
||
|
| setValue | 设置文本框值|value|
|
||
7 years ago
|
| setFieldTextValueMap | 设置字段集合 | fieldTextValueMap |
|
||
7 years ago
|
| refresh | 刷新文本框 | —|
|
||
|
|
||
|
|
||
|
|
||
|
---
|
||
|
|
||
7 years ago
|
|