【问题标题】:Add Checkbox column in flexigrid在 flexigrid 中添加复选框列
【发布时间】:2010-04-28 02:32:11
【问题描述】:
【问题讨论】:
标签:
php
jquery
jquery-plugins
flexigrid
【解决方案1】:
我认为您不再需要该复选框,因为 flexigrid 行是可选择的。
但是,如果您真的想继续这个想法......
在处理 json 上的网格数据的 php 文件中,您只需在单元格上添加复选框,并在其上添加一个 id
即
while(true){
$json .= ",";
$json .= "\n{";
$json .= "id:'".$id."',";
$json .= "cell:['".$col1."',";
$json .= "'".$col2."',";
$json .= "'<input id=\"dataid".$id."\" class="datacb" type=\"checkbox\" value=\"".$id.""\/>'";
$json .= "]\n";
$json .= "}";
}
在删除功能下的 javascript 文件中
var ids;
$('.datacb').each(function(){ if($(this).is(':checked')){
ids += $(this).val()+","; } });
/*将ids发送到php进行处理
*/
【解决方案2】:
在选项中添加"showCheckbox: true"以添加复选框