方法入口
var $checkbox = $().$b("checkbox",config) //返回组件的jQuery对象,即下面模板的jQuery对象
组件模板
<span id="<%=id%>" >
<% if( checkboxArray.length != 0){ %>
<table>
<% if( arrange == 'h' ){ %>
<tr>
<% for(var i=0; i < checkboxArray.length; i++){ %>
<td>
<input
style="height:auto;<%= style %>"
type="checkbox"
id="<%=id%>_<%=i%>"
value="<%=checkboxArray[i].value%>"
<%= defaultValue === checkboxArray[i].value ? "checked" : "" %>
/>
<label for="<%= id %>_<%= i %>"><%= checkboxArray[i].name %></label>
</td>
<% } %>
</tr>
<% }else{ %>
<% for(var i=0; i < checkboxArray.length; i++){ %>
<tr>
<td>
<input
style="height:auto;<%= style %>"
type="checkbox"
id="<%=id%>_<%=i%>"
value="<%=checkboxArray[i].value%>"
<%= defaultValue === checkboxArray[i].value ? "checked" : "" %>
/>
<label for="<%= id %>_<%= i %>"><%= checkboxArray[i].name %></label>
</td>
</tr>
<% } %>
<% } %>
</table>
<% }else{%>
<span><%= emptyMsg %></span>
<% } %>
</span>
配置属性(通用属性参看2.3节)
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
localOption | Array | [] | 复选框选项,静态数据源,固定不变 |
dataOption | Array | [] | 复选框选项,动态数据源 |
isVerify | Boolean | false | 组件是否需要验证 |
arrange | String | "h" | "h"水平排列,"v"垂直排列 |
tplUrl | String | "template/checkbox.html" | 模板路径 |
暂无 | ||
说明 | ||
入参 | ||
返回 |