方法入口
var $table= $().$b("table",config) //返回组件的jQuery对象,即下面模板的jQuery对象
组件模板
<span>
<div class="blo_toolbar <%= className %>" style="<%= style %>"></div>
<table style="<%=style%>" class="blo_table <%= className %>">
<thead>
<%if(selectType!="none"){%>
<th style="width:30px;"> </th>
<%}%>
<% for(var i=0; i < headerKey.length; i++){ %>
<th><%= header[headerKey[i]] %></th>
<% } %>
</thead>
<tbody>
</tbody>
</table>
</span>
配置属性(通用属性参看2.3节)
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| headerKey | Array | [] | 列头key |
| header | Array | [] | 对应列头key的中文名称 |
| row | Array | [] | 数据行 |
| selectType | String | none | none无选框,single单选框,mutil复选框 |
| toolbar | Array | [] | 工具栏里的按钮,按钮需要是Ballon的button对象 |
| tplUrl | String | template/select.html | 模板路径 |
| getSelectRow | ||
| 说明 | 获得当前的选中行 | |
| 入参 | 无 | |
| 返回 | selectRow | 当前选中行的数组集合 |
本文介绍了一个表格组件的配置方法及使用方式,包括组件的初始化、模板定义、配置属性及方法。通过不同的配置选项,可以实现列头显示、数据行展示、选择类型设置等功能。
977

被折叠的 条评论
为什么被折叠?



