方法入口
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" | 模板路徑 |
暫無 | ||
說明 | ||
入參 | ||
返回 |