要实现的问题是这样的(很有难度)有一个信息列表   checkbox     采购编码
      0             1
      0             1
      0             1
      0             2
      0             2
      0             3
      button按钮
初始化时checkbox的状态都是未被勾选(0),当点了按钮时开始判断如果采购编码相同,那么相对应的checkbox只有第一个能够被使用也就是(disabled属性)其他都是不可用的也就是以上的界面就变成  checkbox     采购编码
      0             1
      1             1
      1             1
      0             2
      1             2
      0             3
      button按钮
就是这么个问题请大家讨论顺便说一下不要问我是哪个大公司,有保密协议不能说的。。

解决方案 »

  1.   

    在checkbox里面添加onclick事件
    function clk(){
    if(this.checked){
       for(var i=0;i<tableObject.rows.count-1;i++){
    if(tableObject.rows[this.perentElement.perentElement.rowIndex].cell[this.perentElement.cellIndex]==tableObject.row[i].cells[this.perentElement.cellIndex])
    tableObject.rows[i].cell[this.perentElement.cellIndex].childNodes[1].disable=true;
    }
    }
    }
      

  2.   

    从第一个checkbox开始,将它的采购编码与其它的checkbox的相比较,如有相同则将相同的checkbox设置为disabled, 如此循环直到到数二个。
    循环过程中,先判断checkbox是否己设为disabled。如果是则continue。
      

  3.   

    这样?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function $(id){
    return document.getElementById(id);
    }function setButtons(){
    var chks=$("tbody1").getElementsByTagName("input");
    var chk,td,code,map={};

    for(var i=0,len=chks.length;i<len;i++){
    chk=chks[i];
    td=chk.parentNode;
    code=td.parentNode
       .cells[1]
       .innerHTML;

    if(!(code in map)){
    map[code]=null;
    chk.checked=false;
    chk.disabled=false;
    }else{
    chk.checked=true;
    chk.disabled=true;
    }
    }
    }
    </script>
    </head>
    <body>
    <table width="448" border="1">
      <thead>
          <tr>
            <td width="66" align="center">选择</td>
            <td width="241" align="center">采购编码 </td>
            <td width="119" align="center">其他</td>
          </tr>
      <thead>
      <tbody id="tbody1">
          <tr>
            <td align="center"><input type="checkbox"/></td>
            <td>1</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="center"><input type="checkbox"/></td>
            <td>1</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="center"><input type="checkbox"/></td>
            <td>1</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="center"><input type="checkbox"/></td>
            <td>2</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="center"><input type="checkbox"/></td>
            <td>2</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="center"><input type="checkbox"/></td>
            <td>3</td>
            <td>&nbsp;</td>
          </tr>
      </tbody>
      <tfoot>    
          <tr>
            <td colSpan="3">
             <input type="button" value="设置" onclick="setButtons()"/>
            </td>
          </tr>
      </tfoot>  
    </table>
    </body>
    </html>