2011-10-27 74 views
1

我有一个MySQL查询获取通过PHP显示。每个返回的记录都被分配一个复选框。表(ReleaseNumber)中的一列包含一个编号不同记录的编号。如何通过版本号创建可折叠的复选框组。我附上了当前状态的图片和我之后的内容(Outlook截图)。用户可以折叠或展开行组。如果选择了一个行组,则所有的子行也被选中。折叠和扩展组的复选框

这可以做到,如果是的话如何? 电流: enter image description here 期望: enter image description here

我的代码是:

<?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>&nbsp;</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来完成呢?任何建议是一如既往的赞赏?

感谢和问候, 莱恩史密斯

回答

0

有几种方法来实现这一目标。你不需要Java。你需要Javascript。

以下jQuery的功能来帮助你完成这个: