dgDetail(一个DataGrid)第一列绑定了CheckBox,另有一个queue(DropDownList),怎么实现,选中checkBox,就把dgDetail中对应的第二列数据加到queue中,取消选中,就移出queue,用javascript实现!

解决方案 »

  1.   

    就说个大概的思路,供参考
    在每个checkbox加个onclick事件 onclick=“onCheckBoxClick(this);”function onCheckBoxClick(checkbox)
    {
        if( checkbox.checked == true)
       {
           var theRow = checkbox.parentElement.parenElement; //第一个parentElement找到checkbox所在的td,第二个是tr
           var value = theRow.cells(1);  // 取出这列的值
           //  加到queue
           
       }
       else
      {
          //没被选中 也是这样
      }
    }