<tr style="display:none">通过点击实现打开与关闭

解决方案 »

  1.   

    I want to know too.
      

  2.   

    <body>
    <table id=aa onclick="a()">
    <tr style="cursor:hand;display:">
    <td>aaaa</td>
    </tr>
    <tr style="cursor:hand;display:">
    <td>bbbbbb</td>
    </tr>
    <tr style="cursor:hand;display:">
    <td>aaaa</td>
    </tr>
    <tr style="cursor:hand;display:">
    <td>bbbbbb</td>
    </tr>
    </table>
    <script>
    function a()
    {
    e=event.srcElement
    if(e.tagName=="TABLE") return
    while(e.tagName!="TR")
    e=e.parentElement
    if(e.rowIndex==document.getElementById("aa").rows.length-1) return
    document.getElementById("aa").rows[e.rowIndex+1].style.display=(document.getElementById("aa").rows[e.rowIndex+1].style.display=='none')?'':'none'
    }
    </script>
    </body>
      

  3.   

    建议使用UltraWebGrid吧。可以实现这种功能
      

  4.   

    To: net_lover(孟子E章) 
      datagrid是服务器控件,并绑定dataset后可以这样做吗??
      

  5.   

    谢谢各位,还没有达到我要的效果,UltraWebGrid没用过
      

  6.   

    能给我一份吗?,谢谢^_^[email protected]
      

  7.   

    [email protected]谢谢 yanyl2001(yany2001)
      

  8.   

    UltraWebGrid结合UltraWebTree很完美的。
      

  9.   


    我也要 谢谢^_^
    [email protected]