2011-10-27 13 views
1

PHPで表示されるmysqlクエリがあります。返される各レコードには、チェックボックスが割り当てられます。テーブル(ReleaseNumber)の列には、異なるレコードをグループ化する番号があります。リリース番号で折りたたみ可能なチェックボックスグループを作成するにはどうすればいいですか?私は現在の状態のイメージと私が何をしているかを(アウトルックのスクリーンショット)添付しました。ユーザーは行グループを折りたたんだり展開したりすることができます。行グループが選択されると、すべてのサブ行も選択されます。チェックボックスのグループを折りたたんで展開する

どうすればいいですか? 電流: 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の関数は、こののお手伝いをする必要があります

関連する問題