標籤:cti 時間 io type table app
$(function () {
$("#checkAll").click(function () {
$(‘input[name="infoids[]"]‘).attr("checked", this.checked);
});
var $subBox = $("input[name=‘infoids[]‘]");
$subBox.click(function () {
$("#checkAll").attr("checked", $subBox.length === $("input[name=‘infoids[]‘]:checked").length ? true : false);
});
});
<table class="datalist">
<tr>
<td class="rv_td3">使用者暱稱</td>
<td class="rv_td4">評價內容</td>
<td class="rv_td5">評價時間</td>
<td class="rv_td7">是否顯示
<input type="checkbox" id="checkAll" name="checkAll" value="1"/>
</td>
</tr>
<volist name="list" id="vo">
<tr>
<td class="rv_td3">{$vo.nick_name}</td>
<td class="rv_td4">{$vo.review_content}</td>
<td class="rv_td5">{$vo.review_time}</td>
<td class="rv_td7">
<if condition="($vo.appear eq 1)">
<input type="checkbox" id="infoids" name="infoids[]" value="{$vo.id}" checked/>
<else/>
<input type="checkbox" id="infoids" name="infoids[]" value="{$vo.id}"/>
</if>
</td>
</tr>
</volist>
</table>