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.
69 lines
2.4 KiB
69 lines
2.4 KiB
7 years ago
|
# bi.pager
|
||
|
|
||
|
## 分页控件,基类[BI.Widget](/core/widget.md)
|
||
|
|
||
|
{% method %}
|
||
7 years ago
|
[source](https://jsfiddle.net/fineui/rhhte9b3/)
|
||
7 years ago
|
|
||
|
{% common %}
|
||
|
```javascript
|
||
|
|
||
|
BI.createWidget({
|
||
|
type: "bi.pager",
|
||
|
height: 50,
|
||
|
pages: 18,
|
||
|
groups: 5,
|
||
|
curr: 6,
|
||
|
first: "首页",
|
||
|
last: "尾页"
|
||
|
});
|
||
|
|
||
|
|
||
|
```
|
||
|
|
||
|
{% endmethod %}
|
||
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
7 years ago
|
| behaviors | 自定义列表中item项的行为,如高亮,标红等 | object| — | {}|
|
||
|
| layouts | 布局| array |— | {type:"bi.horizontal",hgap:10,vgap:0} |
|
||
7 years ago
|
| dynamicShow | 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 | boolean| true,false | true|
|
||
|
| dynamicShowFirstLast | 是否动态显示首页、尾页,dynamicShow为false时生效| boolean| true,false | false |
|
||
|
| dynamicShowPrevNext | 是否动态显示上一页、下一页,dynamicShow为false时生效 | boolean| true,false | false|
|
||
|
| pages | 是否显示总页数 | boolean| true,false|false|
|
||
7 years ago
|
| curr | 初始化当前页 | function | —| function(){return 1;}|
|
||
|
| groups | 连续显示分页数 | number | — | 0 |
|
||
|
| jump | 页数跳转| function |— | —|
|
||
7 years ago
|
| first | 是否显示首页 | boolean | true,false| false|
|
||
|
| last | 是否显示尾页 | boolean | true,false| false|
|
||
7 years ago
|
| prev | 上一页 | string,object —| — |"上一页" |
|
||
|
| next | 下一页 | sting,object| —| "下一页" |
|
||
|
| firstPage | 第一页 | number|— | 1 |
|
||
|
| lastPage | 最后一页,在万不得已时才会调用这个函数获取最后一页的页码, 主要作用于setValue方法 | function | —| function(){ return 1;}|
|
||
|
| hasPrev | 判断是否有上一页,pages不可用时有效 | function | —| — |
|
||
|
| hasNext | 判断是否有下一页,pages不可用时有效 | function |— | — |
|
||
7 years ago
|
|
||
|
|
||
|
## 对外方法
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| getCurrentPage | 获取当前页码 | —|
|
||
|
| setAllPages | 设置总页数 | pages |
|
||
|
| hasPrev | 判断是否有上一页 | v |
|
||
|
| hasNext | 判断是否有下一页 | v |
|
||
|
| setValue | 设置当前页码 | v |
|
||
7 years ago
|
| getValue | 获取当前页码 | —|
|
||
7 years ago
|
| attr | 设置属性 | key,value |
|
||
7 years ago
|
| populate | 刷新或者清空列表| —|
|
||
7 years ago
|
|
||
7 years ago
|
## 事件
|
||
|
| 名称 | 说明 |
|
||
|
| :------ |:------------- |
|
||
|
| BI.Pager.EVENT_AFTER_POPULATE | pager刷新完成事件 |
|
||
7 years ago
|
|
||
|
---
|
||
|
|
||
7 years ago
|
|