Php 折叠和展开复选框的组
我有一个通过PHP显示的mysql查询。每个返回的记录都分配了一个复选框。表中的一列(ReleaseNumber)有一个编号,用于对不同的记录进行分组。如何按版本号创建可折叠的复选框组。我已经附上了当前状态和我所追求的东西的图片(outlook屏幕截图)。用户可以折叠或展开行组。如果选择了行组,则也会选择所有子行 可以这样做吗?如果可以,怎么做? 当前: 渴望的: 我的代码是:Php 折叠和展开复选框的组,php,mysql,checkbox,expand,collapse,Php,Mysql,Checkbox,Expand,Collapse,我有一个通过PHP显示的mysql查询。每个返回的记录都分配了一个复选框。表中的一列(ReleaseNumber)有一个编号,用于对不同的记录进行分组。如何按版本号创建可折叠的复选框组。我已经附上了当前状态和我所追求的东西的图片(outlook屏幕截图)。用户可以折叠或展开行组。如果选择了行组,则也会选择所有子行 可以这样做吗?如果可以,怎么做? 当前: 渴望的: 我的代码是: <?php mysql_connect("localhost", "username", "passw
<?php
mysql_connect("localhost", "username", "password")or die("cannot connect");
mysql_select_db("database")or die("cannot select DB");
$sql="SELECT`despgoodsid` ,`crtd dept` ,`customer` ,`loc cust rel` ,`case no` ,`gross mass` ,`case width` ,`case length` FROM despgoods_alldetails WHERE transporttypename ='localjhb' AND locstatus ='unplanned' AND customer <>'customer' AND `loc cust rel` > 0 ";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
putenv("TZ=Africa/Johannesburg");
?>
<table border=0>
<tr>
<td>
<form name="form1" method="post">
<table border=0 id="hor-minimalist-a">
<tr>
<th> </th>
<th width=150><center>Release Number</th>
<th width=150>Dispatch Area</th>
<th width=150>Customer</th>
<th width=130><center>Case Number</th>
<th width=80><center>Weight</th>
<th width=80><center>Width</th>
<th width=80><center>Length</th>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td><input type="checkbox" name=check[] value="<?php echo $rows['despgoodsid']; ?>"></td>
<td><center><?php echo $rows['loc cust rel']; ?></td>
<td><?php echo $rows['crtd dept']; ?></td>
<td><?php echo $rows['customer']; ?></td>
<td><center><?php echo $rows['case no']; ?></td>
<td><center><?php echo $rows['gross mass']; ?></td>
<td><center><?php echo $rows['case width']; ?></td>
<td><center><?php echo $rows['case length']; ?></td>
</tr>
<?php
}
?>
</table>
<table>
<tr>
<td colspan=3><input name="Next" type="submit" id="Next" value="Next"></td>
</tr></table>
我需要一些Java来完成这个吗?如有任何建议,我们将一如既往地感激
感谢和问候,
Ryan Smith有几种方法可以实现这一点。您不需要Java。你需要Javascript 以下jQuery函数应该可以帮助您实现这一点: