在gridview第一列放了checkbox,当选中的时候,改行的dropdownlist的enable为true,否则为false,请教这个该怎么写呢?
下面这个连该行的label和checkbox一起操作了,只操作dropdownlist该怎样写呢?谢谢function setEnable(inputChk,isChecked)
    {
       var td = $(inputChk).parent().parent();
       td.children().each(function(){
          if(this!=inputChk){
                isChecked?$(this).attr("disabled",false):$(this).attr("disabled",true);
          }
       });
    } 

解决方案 »

  1.   

     td.children(".dropdownlist的类名").each()或者
    not()排除label和checkbox
      

  2.   


    function setEnable(inputChk,isChecked) 
        { 
          var td = $(inputChk).parent().parent(); 
          td.children().each(function(){ 
              if($(this)!=inputChk && $(this).attr("nodeName").toUpperCase!="LABLE"){ 
                    isChecked?$(this).attr("disabled",false):$(this).attr("disabled",true); 
              } 
          }); 
        } 
      

  3.   

    上面LABEL写错了,改一下。如果是select的话可以直接 
    if($(this).attr("nodeName").toUpperCase!="SELECT"){ function setEnable(inputChk,isChecked) 
        { 
          var td = $(inputChk).parent().parent(); 
          td.children().each(function(){ 
              if($(this)!=inputChk && $(this).attr("nodeName").toUpperCase!="LABEL"){ 
                    isChecked?$(this).attr("disabled",false):$(this).attr("disabled",true); 
              } 
          }); 
        } 
      

  4.   

    if($(this).attr("nodeName").toUpperCase=="SELECT")